This commit is contained in:
2021-02-17 00:06:03 +08:00
parent 3877b0fb29
commit c0a2476e7c
+5 -7
View File
@@ -45,7 +45,6 @@ abstract class Pool extends Component
}
/**
* @param $name
* @return array
@@ -68,7 +67,6 @@ abstract class Pool extends Component
}
/**
* @param $cds
* @param false $isMaster
@@ -126,13 +124,13 @@ abstract class Pool extends Component
*/
public function createConnect(array $config, string $coroutineName, callable $createHandler): PDO|Redis|false
{
if (Context::hasContext('create:connect:' . $coroutineName)) {
while (($client = Context::getContext($coroutineName)) != null){
var_dump($client);
}
var_dump($client);
if ($client = Context::getContext($coroutineName)) {
return $client;
}
if (Context::hasContext('create:connect:' . $coroutineName)) {
Coroutine::sleep(0.001);
return $this->createConnect($config, $coroutineName, $createHandler);
}
Context::setContext('create:connect:' . $coroutineName, 1);
$client = call_user_func($createHandler, ...$config);