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); - } + }); } }