Optional timeout parameter with each request #99

erfaan opened this Issue Oct 30, 2012 · 0 comments


None yet
2 participants

erfaan commented Oct 30, 2012

Network programming is always notoriously unreliable. There can be DNS errors or server not responding errors. According to python documentation:

The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be used). This actually only works for HTTP, HTTPS and FTP connections.

We assume that the default timeout will work and leave this parameter empty with our requests. But the urllib2 doesn't specify a default timeout. Neither does the httplib or socket lib.

The problem?
The application thread would freeze forever when the twitter API is not responding. We must provide a way to pass some timeout to the actual urlopen call.

@sixohsix sixohsix closed this in a5aab11 Nov 3, 2012

sixohsix added a commit that referenced this issue Nov 3, 2012

Merge pull request #100 from erfaan/master
Fixed #99
Introduced an optional parameter `timeout` which each API request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment