This commit is contained in:
as2252258@163.com
2021-09-06 01:57:01 +08:00
parent 05adb043f2
commit 5bd3d98250
+5 -7
View File
@@ -47,14 +47,12 @@ class Pool extends Component
*/
protected function pop(Channel $channel, $retain_number): void
{
if (!Context::inCoroutine()) {
$channel->close();
return;
}
while ($channel->length() > $retain_number) {
$connection = $channel->pop();
if ($connection instanceof StopHeartbeatCheck) {
$connection->stopHeartbeatCheck();
if (Context::inCoroutine()) {
$connection = $channel->pop();
if ($connection instanceof StopHeartbeatCheck) {
$connection->stopHeartbeatCheck();
}
}
}
}