This commit is contained in:
2021-04-27 17:49:09 +08:00
parent 682d17deca
commit 2b2cd508d7
+10 -9
View File
@@ -168,15 +168,16 @@ abstract class Pool extends Component
if (!Context::inCoroutine()) { if (!Context::inCoroutine()) {
return $this->createClient($name, $callback); return $this->createClient($name, $callback);
} }
// if ($this->_items[$name]->length() > 10) { $channel = $this->_items[$name];
// $connection = $this->_items[$name]->pop(); if ($channel->isEmpty()) {
// if (!$this->checkCanUse($name, $connection)) { return $this->createByCallback($name, $callback);
// return $this->createClient($name, $callback); }
// } else { $connection = $channel->pop(0.002);
// return $connection; if (!$this->checkCanUse($name, $connection)) {
// } return $this->createClient($name, $callback);
// } } else {
return $this->createClient($name, $callback); return $connection;
}
} }