From 843abbeaa623d6ff36ce525e8580800094609b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 11 Jul 2022 18:53:19 +0800 Subject: [PATCH] modify plugin name --- kiri-engine/Pool/PoolQueue.php | 3 +++ kiri-engine/Pool/SplQueue.php | 3 +++ 2 files changed, 6 insertions(+) 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; }