modify plugin name

This commit is contained in:
2022-02-23 16:32:08 +08:00
parent 8824f711bb
commit 688b2381da
3 changed files with 14 additions and 9 deletions
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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));
}
}