protected function registerSignalHandler(WorkerInterface $worker): void
    {
        $this->logger->info('Register a signal handler that a worker should respond to');

        SignalHandler::create(
            SignalHandler::KNOWN_SIGNALS,
            function (int $signal, string $signalName) use ($worker) {
                $this->logger->info('{type}: Was received recognized signal {signal}', [
                    'type'   => $worker->getName(),
                    'signal' => $signalName,
                ]);

                switch ($signal) {
                    case SIGTERM:
                        $worker->shutDownNow();
                        break;
                    case SIGINT:
                        $worker->shutDownNow();
                        break;
                    case SIGQUIT:
                        $worker->shutdown();
                        break;
                    case SIGUSR1:
                        $worker->killChildren();
                        break;
                    case SIGUSR2:
                        $worker->pauseProcessing();
                        break;
                    case SIGCONT:
                        $worker->unPauseProcessing();
                        break;
                }
            }
        );
    }