src/ProcessPool.php
/**
	 * Release a process
	 *
	 * @param ProcessPoolRequest $process Process
	 * @throws ProcessPoolException
	 */
Release a process
@param ProcessPoolRequest $process Process
@throws ProcessPoolException
Release a process @param ProcessPoolRequest $process Process @throws ProcessPoolException
public function releaseProcess(ProcessPoolRequest $process): void
	{
		$procIdx = null;
		foreach ($this->runningProcs as $idx=>$runningProc)
		{
			if ($runningProc === $process)
			{
				$procIdx = $idx;
				break;
			}
		}
		if ($procIdx === null)
			throw new ProcessPoolInvalidProcessException();
		$process->freeRequest();
		array_splice($this->runningProcs, $procIdx, 1);
		if ($process->hasFailed())
			$this->addProcess();
		else if ($this->getNumUnassignedProcesses() + 1 < $this->maxNumUnassignedProcs)
			$this->unassignedProcs[] = $process;
	}
public function releaseProcess ( ProcessPoolRequest $ process ) : void { $ procIdx = null ; foreach ( $ this -> runningProcs as $ idx => $ runningProc ) { if ( $ runningProc === $ process ) { $ procIdx = $ idx ; break ; } } if ( $ procIdx === null ) throw new ProcessPoolInvalidProcessException ( ) ; $ process -> freeRequest ( ) ; array_splice ( $ this -> runningProcs , $ procIdx , 1 ) ; if ( $ process -> hasFailed ( ) ) $ this -> addProcess ( ) ; else if ( $ this -> getNumUnassignedProcesses ( ) + 1 < $ this -> maxNumUnassignedProcs ) $ this -> unassignedProcs [ ] = $ process ; }
Release a process
 @param ProcessPoolRequest $process Process
 @throws ProcessPoolException
Release a process @param ProcessPoolRequest $process Process @throws ProcessPoolException
// Find process // Start a new process on failure // Add this process back to the pool if needed