public function stop($signal = null)
    {
        if (!$this->running) {
            return;
        }

        if (null !== $signal) {
            $this->getLogger()->info('Stop called because of signal #'.$signal.'. Current state: '.$this->worker->getState().'.');
        } else {
            $this->getLogger()->info('Stop called: '.$this->worker->getState().'.');
        }

        $this->running = false;
        $this->worker->shutdown();
    }