src/Process/Dispatcher.php
private function registerSignals()
    {
        foreach ($this->signalHandler->getSignals() as $signal) {
            $this->logger->debug('Registering signal', [
                'signal' => $signal
            ]);

            Loop::onSignal($signal, function ($signalId, $signal) {
                $promise = $this->signalHandler->handle($signal);
                $promise->onResolve(function ($error, $value) {
                    if ($error) {
                        $this->logger->info($error->getMessage());
                        return;
                    }

                    if ($value === null) {
                        $this->logger->info('Signal successfully handled. RPQ is now shutting down. Goodbye.');
                        exit(0);
                    }
                });
            });
        }

        $this->setIsRunning(true);
    }
private function registerSignals()
    {
        foreach ($this->signalHandler->getSignals() as $signal) {
            $this->logger->debug('Registering signal', [
                'signal' => $signal
            ]);

            Loop::onSignal($signal, function ($signalId, $signal) {
                $promise = $this->signalHandler->handle($signal);
                $promise->onResolve(function ($error, $value) {
                    if ($error) {
                        $this->logger->info($error->getMessage());
                        return;
                    }

                    if ($value === null) {
                        $this->logger->info('Signal successfully handled. RPQ is now shutting down. Goodbye.');
                        exit(0);
                    }
                });
            });
        }

        $this->setIsRunning(true);
    }
Registers signals

@return void