改名
This commit is contained in:
@@ -127,11 +127,10 @@ abstract class Pool extends Component
|
|||||||
public function createConnect(array $config, string $coroutineName, callable $createHandler): PDO|Redis|false
|
public function createConnect(array $config, string $coroutineName, callable $createHandler): PDO|Redis|false
|
||||||
{
|
{
|
||||||
if (Context::hasContext('create:connect:' . $coroutineName)) {
|
if (Context::hasContext('create:connect:' . $coroutineName)) {
|
||||||
while (!($client = Context::hasContext($coroutineName))){
|
while (!($client = Context::getContext($coroutineName))){
|
||||||
var_dump($client);
|
var_dump($client);
|
||||||
}
|
}
|
||||||
var_dump($client);
|
return $client;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
Context::setContext('create:connect:' . $coroutineName, 1);
|
Context::setContext('create:connect:' . $coroutineName, 1);
|
||||||
|
|
||||||
@@ -139,7 +138,7 @@ abstract class Pool extends Component
|
|||||||
|
|
||||||
Context::deleteId('create:connect:' . $coroutineName);
|
Context::deleteId('create:connect:' . $coroutineName);
|
||||||
|
|
||||||
return $client;
|
return Context::setContext($coroutineName, $client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -151,10 +151,7 @@ class Connection extends Pool
|
|||||||
return Context::getContext($coroutineName);
|
return Context::getContext($coroutineName);
|
||||||
}
|
}
|
||||||
if (!$this->hasItem($coroutineName)) {
|
if (!$this->hasItem($coroutineName)) {
|
||||||
if (($client = $this->newClient($config, $coroutineName)) == true) {
|
return $this->newClient($config, $coroutineName);
|
||||||
return Context::getContext($coroutineName);
|
|
||||||
}
|
|
||||||
return Context::setContext($coroutineName, $client);
|
|
||||||
}
|
}
|
||||||
[$time, $connections] = $this->get($coroutineName);
|
[$time, $connections] = $this->get($coroutineName);
|
||||||
if (!($connections instanceof PDO)) {
|
if (!($connections instanceof PDO)) {
|
||||||
|
|||||||
@@ -47,10 +47,7 @@ class Redis extends Pool
|
|||||||
return Context::getContext($coroutineName);
|
return Context::getContext($coroutineName);
|
||||||
}
|
}
|
||||||
if (!$this->hasItem($coroutineName)) {
|
if (!$this->hasItem($coroutineName)) {
|
||||||
if (($client = $this->newClient($config, $coroutineName)) == true) {
|
return $this->newClient($config, $coroutineName);
|
||||||
return Context::getContext($coroutineName);
|
|
||||||
}
|
|
||||||
return Context::setContext($coroutineName, $client);
|
|
||||||
}
|
}
|
||||||
[$time, $clients] = $this->get($coroutineName);
|
[$time, $clients] = $this->get($coroutineName);
|
||||||
if ($clients === null) {
|
if ($clients === null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user