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