public function getFirstProcess()
    {
        $firstProcess = null;
        foreach ($this->process as $process) {
            if ($this->isRunning() && ! $process->isRunning()) {
                $this->detach($process);
                continue;
            }

            if (null !== $firstProcess) {
                continue;
            }
            $firstProcess = $process;
        }

        return $firstProcess;
    }
public function getFirstProcess()
    {
        $firstProcess = null;
        foreach ($this->process as $process) {
            if ($this->isRunning() && ! $process->isRunning()) {
                $this->detach($process);
                continue;
            }

            if (null !== $firstProcess) {
                continue;
            }
            $firstProcess = $process;
        }

        return $firstProcess;
    }
public function getFirstProcess ( ) { $ firstProcess = null ; foreach ( $ this -> process as $ process ) { if ( $ this -> isRunning ( ) && ! $ process -> isRunning ( ) ) { $ this -> detach ( $ process ) ; continue ; } if ( null !== $ firstProcess ) { continue ; } $ firstProcess = $ process ; } return $ firstProcess ; }
Returns the fist process in the queue.

Try to detach finished processes from the pool.

@return Process|null
Returns the fist process in the queue .