public function poll()
    {
        if ($this->completed || !$this->hasStarted()) {
            return false;
        }

        if ($this->process->isRunning()) {
            if ($this->updateOnPoll) {
                $this->dispatch(RunEvent::UPDATED, new RunEvent($this));
            }
            return true;
        }

        $this->completed = true;
        $this->setFinished();

        if ($this->process->isSuccessful()) {
            $this->successful = true;
            $this->dispatch(RunEvent::SUCCESSFUL, new RunEvent($this));
        } else {
            $this->dispatch(RunEvent::FAILED, new RunEvent($this));
        }
        $this->dispatch(RunEvent::COMPLETED, new RunEvent($this));

        return false;
    }