From 56dc2989939ea177a40273b07e651480a2ea0851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 3 Sep 2020 00:57:07 +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 --- system/Process/Leafleting.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/system/Process/Leafleting.php b/system/Process/Leafleting.php index 3486adf0..96d8779f 100644 --- a/system/Process/Leafleting.php +++ b/system/Process/Leafleting.php @@ -6,6 +6,7 @@ namespace Snowflake\Process; use Exception; use Snowflake\Snowflake; +use Swoole\Coroutine; use Swoole\Timer; /** @@ -21,9 +22,11 @@ class Leafleting extends Process */ public function onHandler(\Swoole\Process $process) { - Timer::tick(1000, function () use ($process) { + while (true) { var_dump($process->read()); - }); + + Coroutine::sleep(1); + } } }