This commit is contained in:
2021-08-31 19:12:57 +08:00
parent 302247866b
commit 7851259003
4 changed files with 127 additions and 16 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Kiri\Rpc;
class RpcManager
{
private static array $_handler = [];
/**
* @param $cmd
* @param array $handler
* @param string $protocol
*/
public static function addCmdHandler($cmd, array $handler, string $protocol)
{
static::$_handler[$cmd] = [$handler, $protocol];
}
/**
* @param $cmd
* @return array|null
*/
public static function getHandler($cmd): ?array
{
return static::$_handler[$cmd] ?? null;
}
}