ext-swooleis supported until v4.7.1, use
ext-openswoole>= v4.7.1. Latest version:
pecl install openswoole-4.10.0
<?php Swoole\Server->getWorkerStatus(int $workerId): int|bool
Return the worker process status value as an integer. This value indicates the workers state.
By passing in the worker process ID you can retrieve the worker status as an integer.
Worker Status Values
SWOOLE_WORKER_BUSY(1): The worker process is busy.
SWOOLE_WORKER_IDLE(2): The worker process is idle.
SWOOLE_WORKER_EXIT(3): When you have the Swoole server set to reload on code changes, there may be two worker processes with the same ID, an old one and a new one, the old worker process waiting to finish and be replaced by the new one will have the exit status.
Available since > v4.5.0