From 150cdbbbfa68df4809dd5a2482b2e8e161cf6ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 11 Jul 2022 17:05:32 +0800 Subject: [PATCH] modify plugin name --- kiri-engine/Pool/Pool.php | 4 +++- kiri-engine/Pool/PoolQueue.php | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/kiri-engine/Pool/Pool.php b/kiri-engine/Pool/Pool.php index 999129bf..ef3652c4 100644 --- a/kiri-engine/Pool/Pool.php +++ b/kiri-engine/Pool/Pool.php @@ -89,7 +89,9 @@ class Pool extends Component $lists = []; $count = $channel->length(); while ($this->status->is(StatusEnum::EXIT) === false) { - $pdo = $channel->pop(); + if (!(($pdo = $channel->pop()) instanceof PDO)) { + break; + } if ($pdo->check()) { $success += 1; } diff --git a/kiri-engine/Pool/PoolQueue.php b/kiri-engine/Pool/PoolQueue.php index f6d6a1bb..b3dabf44 100644 --- a/kiri-engine/Pool/PoolQueue.php +++ b/kiri-engine/Pool/PoolQueue.php @@ -17,11 +17,11 @@ class PoolQueue implements QueueInterface */ public function __construct(public int $max) { -// if (Context::inCoroutine()) { -// $this->queue = new Channel($this->max); -// } else { + if (Context::inCoroutine()) { + $this->queue = new Channel($this->max); + } else { $this->queue = new SplQueue($this->max); -// } + } }