From 524d2b8664ab3367554e1f5ecb838c031f46292d Mon Sep 17 00:00:00 2001 From: xl Date: Wed, 4 Sep 2024 10:14:30 +0800 Subject: [PATCH] eee --- RpcProcess.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/RpcProcess.php b/RpcProcess.php index fb20c55..540e853 100644 --- a/RpcProcess.php +++ b/RpcProcess.php @@ -5,6 +5,7 @@ namespace Kiri\Rpc; use Kiri\Di\Context; use Kiri\Server\Processes\AbstractProcess; use Swoole\Coroutine; +use Swoole\Process; use function pcntl_signal; class RpcProcess extends AbstractProcess @@ -21,27 +22,19 @@ class RpcProcess extends AbstractProcess /** - * @param \Swoole\Process|null $process + * @param Process|null $process * @return void */ - public function process(?\Swoole\Process $process): void + public function process(?Process $process): void { } /** - * @return $this + * @return void */ - public function onSigterm(): static + public function onSigterm(): void { - // TODO: Implement onSigterm() method. - if (Context::inCoroutine()) { - Coroutine::create(fn() => $this->onShutdown(Coroutine::waitSignal(SIGTERM | SIGINT))); - } else { - pcntl_signal(SIGTERM, [$this, 'onStop']); - pcntl_signal(SIGINT, [$this, 'onStop']); - } - return $this; } } \ No newline at end of file