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;
    }
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;
    }
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 ; }
Poll the process to see if it is still running, and trigger events

@return bool true if the process is currently running (started and not terminated)
Poll the process to see if it is still running and trigger events