Re: Timeouts on Agent requests

Erik Forsberg <[email protected]>
Newsgroups gmane.comp.python.twisted.web
Message-ID <[email protected]>
On 2012-08-20 07:34, Erik Forsberg wrote:
> Will this also automatically give me a connection timeout, or should I
> give Agent's constructor connectTimeout as argument and handle that in
> handle_errors too?

After some experiments, I think I can answer my own question:

* If you're using a callLater to deferred.cancel only, regardless of 
cause of the timout (connection timeout or request timeout), your 
errback will get ConnectingCancelledError.

* If you use connectTimeout and a delayed call to deferred.cancel, and 
connectTimeout set to a lower value than the callback to 
deferred.cancel, you will get a TimeoutError in your errback if the 
connection times out. This allows you to distuingish between connection 
timeouts and request timeouts.

Regards,
\EF
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.