diff --git a/kiri-engine/Pool/PoolQueue.php b/kiri-engine/Pool/PoolQueue.php index 4dc08c4a..d7e086ae 100644 --- a/kiri-engine/Pool/PoolQueue.php +++ b/kiri-engine/Pool/PoolQueue.php @@ -40,6 +40,9 @@ class PoolQueue implements QueueInterface */ public function push(mixed $data, float $timeout = -1): bool { + if ($this->isFull()) { + return false; + } if (!$this->isClose()) { return $this->queue->push($data, $timeout); } diff --git a/kiri-engine/Pool/SplQueue.php b/kiri-engine/Pool/SplQueue.php index 3fbfba52..c7410d1c 100644 --- a/kiri-engine/Pool/SplQueue.php +++ b/kiri-engine/Pool/SplQueue.php @@ -44,6 +44,9 @@ class SplQueue implements QueueInterface public function push(mixed $data, float $timeout = -1): bool { // TODO: Implement push() method. + if ($this->isFull()) { + return false; + } $this->channel->enqueue($data); return true; }