Ejemplo n.º 1
0
    def _cb_timeout(response: Response, request: Request, timeout: float,
                    timeout_cl: DelayedCall) -> Response:
        if timeout_cl.active():
            timeout_cl.cancel()
            return response

        url = urldefrag(request.url)[0]
        raise TimeoutError(
            f"Getting {url} took longer than {timeout} seconds.")
Ejemplo n.º 2
0
 def cancel(self):
     if self.cancelled or self.called:
         self.cancelled = True
         return
     return TwistedDelayedCall.cancel(self)
Ejemplo n.º 3
0
 def cancel(self):
     if self.cancelled or self.called:
         self.cancelled = True
         return
     return TwistedDelayedCall.cancel(self)