예제 #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.")
예제 #2
0
파일: twistedr.py 프로젝트: hardys/eventlet
 def cancel(self):
     if self.cancelled or self.called:
         self.cancelled = True
         return
     return TwistedDelayedCall.cancel(self)
예제 #3
0
파일: twistedr.py 프로젝트: esh/invaders
 def cancel(self):
     if self.cancelled or self.called:
         self.cancelled = True
         return
     return TwistedDelayedCall.cancel(self)