modify
This commit is contained in:
@@ -101,6 +101,7 @@ abstract class Pool extends Component
|
||||
$names[] = $name;
|
||||
$this->pop($channel, $name, $retain_number);
|
||||
}
|
||||
$this->_items = [];
|
||||
if ($retain_number == 0) {
|
||||
Timer::clear($this->creates);
|
||||
$this->creates = -1;
|
||||
@@ -128,6 +129,9 @@ abstract class Pool extends Component
|
||||
*/
|
||||
protected function pop($channel, $name, $retain_number): void
|
||||
{
|
||||
if (Coroutine::getCid() === -1) {
|
||||
return;
|
||||
}
|
||||
while ($channel->length() > $retain_number) {
|
||||
$connection = $channel->pop();
|
||||
if ($connection) {
|
||||
|
||||
Reference in New Issue
Block a user