变更
This commit is contained in:
@@ -186,6 +186,14 @@ class Connection extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function flush($coroutineName, $minNumber = 1) {
|
||||||
|
$this->pool->flush($coroutineName, $minNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $coroutineName
|
* @param $coroutineName
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|||||||
@@ -41,12 +41,13 @@ class Pool extends Component
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $channel
|
* @param $name
|
||||||
* @param $retain_number
|
* @param $retain_number
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function flush($channel, $retain_number)
|
public function flush($name, $retain_number)
|
||||||
{
|
{
|
||||||
|
$channel = $this->channel($name);
|
||||||
$this->pop($channel, $retain_number);
|
$this->pop($channel, $retain_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,16 +176,13 @@ class Pool extends Component
|
|||||||
/**
|
/**
|
||||||
* @param $channel
|
* @param $channel
|
||||||
* @param $minx
|
* @param $minx
|
||||||
* @return mixed
|
* @return void
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
protected function maxIdleQuantity($channel, $minx): mixed
|
protected function maxIdleQuantity($channel, $minx): void
|
||||||
{
|
{
|
||||||
$connection = $channel->pop();
|
|
||||||
if ($channel->length() > $minx) {
|
if ($channel->length() > $minx) {
|
||||||
$this->pop($channel, $minx);
|
$this->pop($channel, $minx);
|
||||||
}
|
}
|
||||||
return $connection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user