111
This commit is contained in:
+3
-3
@@ -5,6 +5,7 @@ namespace Kiri\Pool;
|
|||||||
|
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Http\Context\Context;
|
||||||
use Kiri\Abstracts\Component;
|
use Kiri\Abstracts\Component;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
@@ -46,9 +47,8 @@ class Pool extends Component
|
|||||||
*/
|
*/
|
||||||
protected function pop(Channel $channel, $retain_number): void
|
protected function pop(Channel $channel, $retain_number): void
|
||||||
{
|
{
|
||||||
if ($channel instanceof Channel && Coroutine::getCid() === -1) {
|
if ($channel instanceof Channel && !Context::inCoroutine()) {
|
||||||
$channel = null;
|
$channel->close();
|
||||||
unset($channel);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while ($channel->length() > $retain_number) {
|
while ($channel->length() > $retain_number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user