protected function dispatchEvent(string $eventName): self
    {
        $dispatcher = $this->getEventDispatcher();
        if (!is_null($dispatcher)) {
            $time = !is_null($this->startTime) ? microtime(true) - $this->startTime : 0;

            $event = new DaemonEvent($this);
            $event->setExecutionTime($time);

            $dispatcher->dispatch($eventName, $event);
        }

        return $this;
    }