diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index 30ae1f75..1bfdf367 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -128,8 +128,10 @@ abstract class Pool extends Component return $client; } if (Context::hasContext('create:connect:' . $coroutineName)) { - Coroutine::sleep(0.001); - return $this->createConnect($config, $coroutineName, $createHandler); + while ($client = Context::getContext($coroutineName)) { + Coroutine::sleep(0.001); + } + return $client; } Context::setContext('create:connect:' . $coroutineName, 1); @@ -206,7 +208,6 @@ abstract class Pool extends Component } - /** * @return Channel[] */