private function registerSignals(OutputInterface $output)
    {
        foreach ($this->signalCallbacks as $signal => $callbacks) {
            foreach ($callbacks as $callback) {
                pcntl_signal($signal, function() use ($signal, $output, $callback) {
                    if ($output->isVerbose()) {
                        $output->writeln("Received signal '$signal', calling registered callback.");
                    }
                    return $callback();
                });
            }
        }
    }