From 8824f711bb3298cdf944d775bffdeec42fd89ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 20 Jan 2022 19:04:16 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=94=B9=E5=90=8D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fdf58326 --- RpcJsonp.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/RpcJsonp.php b/RpcJsonp.php index b4fd0df..c56fdc7 100644 --- a/RpcJsonp.php +++ b/RpcJsonp.php @@ -57,13 +57,13 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa */ public function init(): void { - $this->eventProvider->on(OnBeforeShutdown::class, [$this, 'onBeforeShutdown']); + $this->getEventProvider()->on(OnBeforeShutdown::class, [$this, 'onBeforeShutdown']); scan_directory(APP_PATH . 'rpc', 'app\Rpc'); - $this->eventProvider->on(OnWorkerStart::class, [$this, 'consulWatches']); - $this->eventProvider->on(OnWorkerExit::class, [$this, 'onWorkerExit']); - $this->eventProvider->on(OnServerBeforeStart::class, [$this, 'register']); + $this->getEventProvider()->on(OnWorkerStart::class, [$this, 'consulWatches']); + $this->getEventProvider()->on(OnWorkerExit::class, [$this, 'onWorkerExit']); + $this->getEventProvider()->on(OnServerBeforeStart::class, [$this, 'register']); $this->manager = Kiri::getDi()->get(RpcManager::class); } @@ -78,7 +78,7 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa public function onBeforeShutdown(OnBeforeShutdown $beforeShutdown) { $doneList = $this->manager->doneList(); - $agent = $this->container->get(Agent::class); + $agent = $this->getContainer()->get(Agent::class); foreach ($doneList as $value) { $agent->service->deregister($value['config']['ID']); $agent->checks->deregister($value['config']['Check']['CheckId']); @@ -207,7 +207,7 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa private function dispatch($data): array { try { - [$handler, $params] = $this->container->get(RpcManager::class)->get($data['service'], $data['method']); + [$handler, $params] = $this->getContainer()->get(RpcManager::class)->get($data['service'], $data['method']); if (is_null($handler)) { throw new \Exception('Method not found', -32601); } else {