This commit is contained in:
2020-09-06 05:37:00 +08:00
parent 4089f0f456
commit 238bcae813
2 changed files with 56 additions and 3 deletions
+12 -2
View File
@@ -126,7 +126,6 @@ abstract class Pool extends Component
{
$this->_items[$name]->push([time(), $client]);
unset($client);
$this->debug('release connect.' . $this->max . ':' . $this->size($name));
}
@@ -138,9 +137,20 @@ abstract class Pool extends Component
if (!isset($this->_items[$name])) {
return;
}
while ([$time, $client] = $this->_items[$name]->pop(0.001)) {
$channel = $this->_items[$name];
while ([$time, $client] = $channel->pop(0.001)) {
unset($client);
}
}
/**
* @return Channel[]
*/
protected function getChannels()
{
return $this->_items;
}
}