public function waitFor($pid, $hang = true) { if (!isset($this->forks[$pid])) { throw new \InvalidArgumentException('There is no fork with PID ' . $pid); } return $this->forks[$pid]->wait($hang); }