From 8695141b3785f06d168c3727f45b0118dc62a373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 2 Mar 2021 14:03:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Events/OnWorkerStart.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index 88452c0e..32b936c5 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -10,6 +10,7 @@ use Snowflake\Abstracts\Config; use Snowflake\Event; use Snowflake\Exception\ComponentException; use Snowflake\Exception\ConfigException; +use Snowflake\Process\Process; use Snowflake\Snowflake; use Swoole\Coroutine; use Swoole\Runtime; @@ -41,6 +42,10 @@ class OnWorkerStart extends Callback { putenv('worker=' . $worker_id); + Process::signal($this->signal, function () { + var_dump(func_get_args()); + }); + Runtime::enableCoroutine(true, $this->hook); Coroutine::set(['enable_deadlock_check' => false]); @@ -51,7 +56,7 @@ class OnWorkerStart extends Callback $this->onWorker($server, $worker_id); } $this->debug(sprintf('%s #%d Pid:%d start.', ucfirst(env('environmental')), $worker_id, $server->worker_pid)); - Coroutine\go([$this, 'onSignal'], $server, $worker_id); +// Coroutine\go([$this, 'onSignal'], $server, $worker_id); }