This commit is contained in:
2021-02-15 20:26:32 +08:00
parent 5b8d424144
commit f5b2fe563f
+1 -6
View File
@@ -129,16 +129,11 @@ abstract class Pool extends Component
return $this->get($coroutineName)[1]; return $this->get($coroutineName)[1];
} }
if (Context::hasContext('create:connect:' . $coroutineName)) { if (Context::hasContext('create:connect:' . $coroutineName)) {
return $this->get($coroutineName)[1]; return null;
} }
Context::setContext('create:connect:' . $coroutineName, 1); Context::setContext('create:connect:' . $coroutineName, 1);
$client = call_user_func($createHandler, ...$config); $client = call_user_func($createHandler, ...$config);
if (!Context::inCoroutine()) {
Context::deleteId('create:connect:' . $coroutineName);
return $client;
}
$this->push($coroutineName, $client);
Context::deleteId('create:connect:' . $coroutineName); Context::deleteId('create:connect:' . $coroutineName);