Command/WorkerCommand.php
private function handleRunningProcess(
        Process $process,
        &$runningCommand,
        &$failed,
        &$hasReceivedSignal,
        &$exitCode,
        &$exitCodeText
    ) {
        if ($process->isRunning()) {
            if ($hasReceivedSignal) {
                return;
            }
            //force it to shut down now!
            if ($this->shutdownNow) {
                $this->output->write("[RECEIVED SIGNAL] Shutting down now!");
                $process->stop(0);
                $hasReceivedSignal = true;
                $this->keepWorking = false;
                $runningCommand = false;
            }
            if ((!$this->keepWorking || $this->shutdownGracefully)) {
                //we need to keep this running until we are finished...
                $this->output->write("[RECEIVED SIGNAL] will shutdown after finishing task");
                $hasReceivedSignal = true;
            }
        } else {
            $runningCommand = false;
            $exitCode = $process->getExitCode();
            $exitCodeText = $process->getExitCode();
            if ($exitCode != 0) {
                $failed = true;
            }
        }
    }
private function handleRunningProcess(
        Process $process,
        &$runningCommand,
        &$failed,
        &$hasReceivedSignal,
        &$exitCode,
        &$exitCodeText
    ) {
        if ($process->isRunning()) {
            if ($hasReceivedSignal) {
                return;
            }
            //force it to shut down now!
            if ($this->shutdownNow) {
                $this->output->write("[RECEIVED SIGNAL] Shutting down now!");
                $process->stop(0);
                $hasReceivedSignal = true;
                $this->keepWorking = false;
                $runningCommand = false;
            }
            if ((!$this->keepWorking || $this->shutdownGracefully)) {
                //we need to keep this running until we are finished...
                $this->output->write("[RECEIVED SIGNAL] will shutdown after finishing task");
                $hasReceivedSignal = true;
            }
        } else {
            $runningCommand = false;
            $exitCode = $process->getExitCode();
            $exitCodeText = $process->getExitCode();
            if ($exitCode != 0) {
                $failed = true;
            }
        }
    }
private function handleRunningProcess ( Process $ process , & $ runningCommand , & $ failed , & $ hasReceivedSignal , & $ exitCode , & $ exitCodeText ) { if ( $ process -> isRunning ( ) ) { if ( $ hasReceivedSignal ) { return ; } //force it to shut down now! if ( $ this -> shutdownNow ) { $ this -> output -> write ( "[RECEIVED SIGNAL] Shutting down now!" ) ; $ process -> stop ( 0 ) ; $ hasReceivedSignal = true ; $ this -> keepWorking = false ; $ runningCommand = false ; } if ( ( ! $ this -> keepWorking || $ this -> shutdownGracefully ) ) { //we need to keep this running until we are finished... $ this -> output -> write ( "[RECEIVED SIGNAL] will shutdown after finishing task" ) ; $ hasReceivedSignal = true ; } } else { $ runningCommand = false ; $ exitCode = $ process -> getExitCode ( ) ; $ exitCodeText = $ process -> getExitCode ( ) ; if ( $ exitCode != 0 ) { $ failed = true ; } } }
Handles any running process waiting for signals..

@param Process $process
@param boolean &$runningCommand
@param boolean &$failed
@param boolean &$hasReceivedSignal
@param integer &$exitCode
@param string  &$exitCodeText
@return void
Handles any running process waiting for signals ..