diff --git a/RpcProcess.php b/RpcProcess.php index 933d718..6975911 100644 --- a/RpcProcess.php +++ b/RpcProcess.php @@ -3,9 +3,10 @@ namespace Kiri\Rpc; use Kiri\Di\Context; -use Kiri\Server\Abstracts\BaseProcess; +use Kiri\Server\Processes\BaseProcess; use Swoole\Coroutine; use Swoole\Process; +use function pcntl_signal; class RpcProcess extends BaseProcess { @@ -39,8 +40,8 @@ class RpcProcess extends BaseProcess if (Context::inCoroutine()) { Coroutine::create(fn() => $this->onShutdown(Coroutine::waitSignal(SIGTERM | SIGINT))); } else { - \pcntl_signal(SIGTERM, [$this, 'onStop']); - \pcntl_signal(SIGINT, [$this, 'onStop']); + pcntl_signal(SIGTERM, [$this, 'onStop']); + pcntl_signal(SIGINT, [$this, 'onStop']); } return $this; }