shazow/urllib3 — pull request #145 by pasha-r (2013-02-01 18:05:08+00:00)
Title: Add "connection timeout" feature in addition to operation timeout.

Hi!

I'd like to suggest a new feature - two types of timeouts.
Regular one - happens when we wait for response from server on existing connection.
And a new one - connection timeout. Raised only when we try to create a new socket connection.
I added new HTTPConnectionPool.__init__ parameter - connect_timeout and two new exceptions ConnectionTimeout and OperationTimeout.

--
But why anybody would need such a thing?

It can be useful when a call to some HTTP API takes a long time to answer the query (for ex. reading lots of data), but not so much to connect to the server.
With this new feature we can set bigger timeout (or even None which blocks until some data is read) and smaller connect_timeout, so network failures, dead API servers or DNS problems could be detected faster.

And thank you so much for the great library!

--
Pasha Kirichenko