modify plugin name
This commit is contained in:
@@ -7,10 +7,10 @@ use Kiri\Core\Network;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri;
|
||||
use Kiri\Rpc\RpcManager;
|
||||
use Kiri\Annotation\Attribute;
|
||||
use Kiri\Annotation\AbstractAttribute;
|
||||
use ReflectionException;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)] class JsonRpc extends Attribute
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)] class JsonRpc extends AbstractAttribute
|
||||
{
|
||||
|
||||
|
||||
|
||||
+11
-6
@@ -25,6 +25,7 @@ use Kiri\Server\Events\OnWorkerStart;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use ReflectionException;
|
||||
use Swoole\Coroutine;
|
||||
use Swoole\Coroutine\Channel;
|
||||
use Swoole\Server;
|
||||
@@ -51,19 +52,23 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa
|
||||
|
||||
private int $timerId;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @throws \Exception
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
$this->getEventProvider()->on(OnBeforeShutdown::class, [$this, 'onBeforeShutdown']);
|
||||
$provider = $this->getEventProvider();
|
||||
$provider->on(OnBeforeShutdown::class, [$this, 'onBeforeShutdown']);
|
||||
|
||||
scan_directory(APP_PATH . 'rpc', 'app\Rpc');
|
||||
|
||||
$this->getEventProvider()->on(OnWorkerStart::class, [$this, 'consulWatches']);
|
||||
$this->getEventProvider()->on(OnWorkerExit::class, [$this, 'onWorkerExit']);
|
||||
$this->getEventProvider()->on(OnServerBeforeStart::class, [$this, 'register']);
|
||||
$provider->on(OnWorkerStart::class, [$this, 'consulWatches']);
|
||||
$provider->on(OnWorkerExit::class, [$this, 'onWorkerExit']);
|
||||
$provider->on(OnServerBeforeStart::class, [$this, 'register']);
|
||||
|
||||
$this->manager = Kiri::getDi()->get(RpcManager::class);
|
||||
}
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ class RpcManager extends Component
|
||||
$this->async($name);
|
||||
}
|
||||
} catch (\Throwable $throwable) {
|
||||
$this->logger()->error(error_trigger_format($throwable));
|
||||
$this->logger->error(error_trigger_format($throwable));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user