改名
This commit is contained in:
@@ -43,6 +43,7 @@ abstract class Pool extends Component
|
|||||||
*/
|
*/
|
||||||
protected function get($name)
|
protected function get($name)
|
||||||
{
|
{
|
||||||
|
$this->debug('get connect.' . $this->size($name));
|
||||||
[$timeout, $connection] = $this->_items[$name]->pop();
|
[$timeout, $connection] = $this->_items[$name]->pop();
|
||||||
if (!$this->checkCanUse($name, $timeout, $connection)) {
|
if (!$this->checkCanUse($name, $timeout, $connection)) {
|
||||||
unset($client);
|
unset($client);
|
||||||
@@ -125,6 +126,7 @@ abstract class Pool extends Component
|
|||||||
public function push($name, $client)
|
public function push($name, $client)
|
||||||
{
|
{
|
||||||
$this->_items[$name]->push([time(), $client]);
|
$this->_items[$name]->push([time(), $client]);
|
||||||
|
unset($client);
|
||||||
$this->debug('release connect.' . $this->size($name));
|
$this->debug('release connect.' . $this->size($name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -156,7 +156,8 @@ 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) {
|
||||||
|
// if ($this->size($coroutineName) < 1 && $this->hasCreate[$coroutineName] < $this->max) {
|
||||||
return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config));
|
return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config));
|
||||||
}
|
}
|
||||||
[$timeout, $connection] = $client = $this->get($coroutineName);
|
[$timeout, $connection] = $client = $this->get($coroutineName);
|
||||||
|
|||||||
Reference in New Issue
Block a user