Fix coroutine server shutdown deprecation

This commit is contained in:
Chirag Aggarwal
2026-04-06 09:15:30 +05:30
parent dacb03053e
commit 210821bdf9
@@ -85,7 +85,7 @@ class Server extends Adapter
public function start()
{
go(function () {
$startServer = function (): void {
$this->initializeRequestSemaphore();
if ($this->onStartCallback) {
@@ -93,7 +93,15 @@ class Server extends Adapter
}
$this->server->start();
});
};
if (Coroutine::getCid() !== -1) {
$startServer();
return;
}
\Swoole\Coroutine\run($startServer);
}
private function initializeRequestSemaphore(): void