This commit is contained in:
xl
2023-05-26 09:20:31 +08:00
parent 0f1a55462e
commit d7fd23800b
5 changed files with 14 additions and 16 deletions
+6 -5
View File
@@ -90,7 +90,7 @@ class Pool extends Component
* @param int $max
* @param \Closure $closure
*/
public function initConnections($name, int $max, \Closure $closure): void
public function created($name, int $max, \Closure $closure): void
{
if (!isset($this->_connections[$name])) {
$this->_connections[$name] = new PoolItem($max, $closure);
@@ -113,12 +113,13 @@ class Pool extends Component
}
/**
* @param $name
* @return bool
*/
public function hasChannel($name): bool
{
if (!isset($this->_connections[$name])) {
return false;
}
return true;
return isset($this->_connections[$name]) && $this->_connections[$name] instanceof PoolItem;
}