protected function monitorPoolProcesses(string $poolName) : bool
    {
        if (empty($this->processes[$poolName])) {
            return true;
        }
        /** @var Process $process */
        foreach ($this->processes[$poolName] as $i => $process) {
            $pid = $process->getPid();
            $workerId = $this->config['server_id'] . '_' . $pid;

            // check if process is still running:
            if ($process->isRunning() === true) {
                continue;
            }

            // if process is not running remove it from system:
            $this->unregisterChildProcess($workerId);
            unset($this->processes[$poolName][$i]);

            // fire up a new process:
            $workerFile = $this->config['pool'][$poolName]['worker_file'];
            $process = $this->startChildProcess($workerFile);
            $this->registerChildProcess($process, $poolName);
        }
        return true;
    }