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