src/WorkerPool.php
protected function reaper($pid = -1) {
		if (!is_int($pid)) {
			$pid = -1;
		}
		$childpid = pcntl_waitpid($pid, $status, WNOHANG);
		while ($childpid > 0) {
			$stopSignal = pcntl_wstopsig($status);
			if (pcntl_wifexited($stopSignal) === FALSE) {
				array_push($this->results, array(
					'pid' => $childpid,
					'abnormalChildReturnCode' => $stopSignal
				));
			}

			$processDetails = $this->workerProcesses->getProcessDetails($childpid);
			if ($processDetails !== NULL) {
				$this->workerPoolSize--;
				$this->workerProcesses->remove($processDetails);
				unset($processDetails);
			}
			$childpid = pcntl_waitpid($pid, $status, WNOHANG);
		}
	}
protected function reaper($pid = -1) {
		if (!is_int($pid)) {
			$pid = -1;
		}
		$childpid = pcntl_waitpid($pid, $status, WNOHANG);
		while ($childpid > 0) {
			$stopSignal = pcntl_wstopsig($status);
			if (pcntl_wifexited($stopSignal) === FALSE) {
				array_push($this->results, array(
					'pid' => $childpid,
					'abnormalChildReturnCode' => $stopSignal
				));
			}

			$processDetails = $this->workerProcesses->getProcessDetails($childpid);
			if ($processDetails !== NULL) {
				$this->workerPoolSize--;
				$this->workerProcesses->remove($processDetails);
				unset($processDetails);
			}
			$childpid = pcntl_waitpid($pid, $status, WNOHANG);
		}
	}
protected function reaper ( $ pid = - 1 ) { if ( ! is_int ( $ pid ) ) { $ pid = - 1 ; } $ childpid = pcntl_waitpid ( $ pid , $ status , WNOHANG ) ; while ( $ childpid > 0 ) { $ stopSignal = pcntl_wstopsig ( $ status ) ; if ( pcntl_wifexited ( $ stopSignal ) === FALSE ) { array_push ( $ this -> results , array ( 'pid' => $ childpid , 'abnormalChildReturnCode' => $ stopSignal ) ) ; } $ processDetails = $ this -> workerProcesses -> getProcessDetails ( $ childpid ) ; if ( $ processDetails !== NULL ) { $ this -> workerPoolSize -- ; $ this -> workerProcesses -> remove ( $ processDetails ) ; unset ( $ processDetails ) ; } $ childpid = pcntl_waitpid ( $ pid , $ status , WNOHANG ) ; } }
Child process reaper
@param int $pid the process id
@see pcntl_waitpid
Child process reaper