protected function rejectRequest($pid, $ex) { $callback = $this->reqs[$pid]->onFailure(); unset($this->reqs[$pid]); $callback($ex); }