modify plugin name
This commit is contained in:
@@ -9,8 +9,11 @@ use Exception;
|
|||||||
use Kiri\Abstracts\Component;
|
use Kiri\Abstracts\Component;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
use Kiri\Abstracts\CoordinatorManager;
|
use Kiri\Abstracts\CoordinatorManager;
|
||||||
|
use Kiri\Annotation\Inject;
|
||||||
use Kiri\Context;
|
use Kiri\Context;
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
|
use Kiri\Server\Abstracts\StatusEnum;
|
||||||
|
use Kiri\Server\WorkerStatus;
|
||||||
use Swoole\Coroutine\Channel;
|
use Swoole\Coroutine\Channel;
|
||||||
|
|
||||||
|
|
||||||
@@ -26,6 +29,14 @@ class Pool extends Component
|
|||||||
|
|
||||||
public int $max = 60;
|
public int $max = 60;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var WorkerStatus
|
||||||
|
*/
|
||||||
|
#[Inject(WorkerStatus::class)]
|
||||||
|
public WorkerStatus $status;
|
||||||
|
|
||||||
|
|
||||||
use Alias;
|
use Alias;
|
||||||
|
|
||||||
|
|
||||||
@@ -69,6 +80,11 @@ class Pool extends Component
|
|||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->status->is(StatusEnum::EXIT)) {
|
||||||
|
$channel->close();
|
||||||
|
return [0, 0];
|
||||||
|
}
|
||||||
|
|
||||||
$success = 0;
|
$success = 0;
|
||||||
$lists = [];
|
$lists = [];
|
||||||
$count = $channel->length();
|
$count = $channel->length();
|
||||||
|
|||||||
@@ -37,7 +37,10 @@ class PoolQueue implements QueueInterface
|
|||||||
*/
|
*/
|
||||||
public function push(mixed $data, float $timeout = -1): bool
|
public function push(mixed $data, float $timeout = -1): bool
|
||||||
{
|
{
|
||||||
return $this->queue->push($data, $timeout);
|
if (!$this->isClose()) {
|
||||||
|
return $this->queue->push($data, $timeout);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user