This commit is contained in:
xl
2022-05-04 03:08:46 +08:00
parent 2620e88447
commit 072db59b9f
+4 -2
View File
@@ -29,8 +29,8 @@ class RpcManager extends Component
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function reRegister(string $serviceName) public function reRegister(string $serviceName): void
{ {
$config = $this->_rpc[$serviceName] ?? []; $config = $this->_rpc[$serviceName] ?? [];
if (empty($config)) { if (empty($config)) {
return; return;
@@ -90,6 +90,8 @@ class RpcManager extends Component
$this->_rpc[$name] = ['id' => $serviceConfig['ID'], 'config' => $serviceConfig]; $this->_rpc[$name] = ['id' => $serviceConfig['ID'], 'config' => $serviceConfig];
} }
Router::addServer('rpc', static function () use ($name, $class) { Router::addServer('rpc', static function () use ($name, $class) {
var_dump($name, $class);
Router::get($name, $class); Router::get($name, $class);
}); });
return true; return true;