modify
This commit is contained in:
@@ -127,7 +127,6 @@ abstract class Pool extends Component
|
|||||||
*/
|
*/
|
||||||
protected function pop($channel, $name, $retain_number): void
|
protected function pop($channel, $name, $retain_number): void
|
||||||
{
|
{
|
||||||
if ($channel->errCode == 0) {
|
|
||||||
while ($channel->length() > $retain_number) {
|
while ($channel->length() > $retain_number) {
|
||||||
$connection = $channel->pop();
|
$connection = $channel->pop();
|
||||||
if ($connection) {
|
if ($connection) {
|
||||||
@@ -135,9 +134,6 @@ abstract class Pool extends Component
|
|||||||
}
|
}
|
||||||
$this->decrement($name);
|
$this->decrement($name);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$this->clearCreateLog($name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -268,9 +264,6 @@ abstract class Pool extends Component
|
|||||||
public function hasItem(string $name): bool
|
public function hasItem(string $name): bool
|
||||||
{
|
{
|
||||||
if (isset($this->_items[$name])) {
|
if (isset($this->_items[$name])) {
|
||||||
if ($this->_items[$name]->errCode == -2) {
|
|
||||||
$this->_items[$name] = new Channel($this->max);
|
|
||||||
}
|
|
||||||
return !$this->_items[$name]->isEmpty();
|
return !$this->_items[$name]->isEmpty();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -286,7 +279,7 @@ abstract class Pool extends Component
|
|||||||
if (!Context::inCoroutine()) {
|
if (!Context::inCoroutine()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!isset($this->_items[$name]) || $this->_items[$name]->errCode == -2) {
|
if (!isset($this->_items[$name])) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return $this->_items[$name]->length();
|
return $this->_items[$name]->length();
|
||||||
@@ -305,9 +298,6 @@ abstract class Pool extends Component
|
|||||||
if (!isset($this->_items[$name])) {
|
if (!isset($this->_items[$name])) {
|
||||||
$this->_items[$name] = new Channel($this->max);
|
$this->_items[$name] = new Channel($this->max);
|
||||||
}
|
}
|
||||||
if ($this->_items[$name]->errCode == -2) {
|
|
||||||
$this->_items[$name] = new Channel($this->max);
|
|
||||||
}
|
|
||||||
if (!$this->_items[$name]->isFull()) {
|
if (!$this->_items[$name]->isFull()) {
|
||||||
$this->_items[$name]->push($client);
|
$this->_items[$name]->push($client);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user