public function fetchResponse(Request $request, $waitForResult = true)
    {
        if ($request->hasResponse()) {
            return $request->getResponse();
        }

        $timer = $this->getFetchTimer($waitForResult);
        $req = new FetchRequest($request->getRequestId(), $waitForResult);

        do {
            try {
                $response = $this->sendFetchRequest($this->getManagerForRequest($request), $req);
                $result = $this->handleFetchResponse($response, $request);

                return $result;
            } catch (TimeoutException $ex) {
                $this->getLogger()->debug($request->getRequestId().': '.$ex->getMessage());
            }
        } while (!$timer->isExpired());

        throw new TimeoutException('Request '.$request->getRequestId().' timed out.');
    }