改名
This commit is contained in:
@@ -153,7 +153,9 @@ abstract class Pool extends Component
|
|||||||
*/
|
*/
|
||||||
public function push(string $name, mixed $client)
|
public function push(string $name, mixed $client)
|
||||||
{
|
{
|
||||||
$this->_items[$name]->push([time(), $client]);
|
if (!$this->_items[$name]->isFull()) {
|
||||||
|
$this->_items[$name]->push([time(), $client]);
|
||||||
|
}
|
||||||
unset($client);
|
unset($client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ class Connection extends Pool
|
|||||||
if (Context::hasContext($coroutineName)) {
|
if (Context::hasContext($coroutineName)) {
|
||||||
return Context::getContext($coroutineName);
|
return Context::getContext($coroutineName);
|
||||||
}
|
}
|
||||||
if ($this->size($coroutineName) < 1 && $this->hasCreate[$coroutineName] < $this->max) {
|
if ($this->size($coroutineName) < 1) {
|
||||||
$this->newClient($config, $coroutineName);
|
$this->newClient($config, $coroutineName);
|
||||||
}
|
}
|
||||||
[$time, $connections] = $this->get($coroutineName);
|
[$time, $connections] = $this->get($coroutineName);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class Redis extends Pool
|
|||||||
*/
|
*/
|
||||||
public function getByChannel($coroutineName, $config): mixed
|
public function getByChannel($coroutineName, $config): mixed
|
||||||
{
|
{
|
||||||
if ($this->_create < $this->max && !$this->hasItem($coroutineName)) {
|
if (!$this->hasItem($coroutineName)) {
|
||||||
$this->newClient($config, $coroutineName);
|
$this->newClient($config, $coroutineName);
|
||||||
}
|
}
|
||||||
[$time, $clients] = $this->get($coroutineName);
|
[$time, $clients] = $this->get($coroutineName);
|
||||||
|
|||||||
Reference in New Issue
Block a user