Add configurable request timeouts
As discussed in #45, this adds both a global consul.Consul(timeout=...) option, and request specific timeout option (e.g. c.kv.get('foo',timeout=...)). This will be applied as both a connect timeout and read timeout to each adapter, so requests could take up to twice this value to time out if they take a long time to connect and read.
Passes the existing tests on my local machine but I don't currently have access to a python 3.4 system or pypy system to test with.
Tests for the timeout options themselves may be a bit sparse and could do with some work, and the test for 'connect timeout' relies on setting a nonzero but tiny timeout to trigger before even a local connect is possible. Could fail randomly but not sure of a better way to test connection timeout at this point.
Thoughts? Improvements? Anything obvious I've missed?
Some work to be done to fix the Python3 / AIO compatibility but a little tricky without a Python 3 development environment. Will get one sorted this weekend.
@cablehead any thoughts on merging this? We also need this as described in https://github.com/cablehead/python-consul/pull/103#issue-155230281
Hi @abn just checking why you've marked this one as not ready?
@cablehead I hadn't completed revewing the changes and was pending testing with a rebase and cleanup. On my list of items for next week.
Ah gotcha. All good. One thought I had (independent of whether to merge this) is it's tough to ensure broadly applied parameters are applied consistently atm. Related to: https://github.com/cablehead/python-consul/issues/68#issuecomment-230127111
Any update on this being merged into master? This seems like a necessity to be able to control the timeout in requests.
This is a fairly critical ask. What do we need to still do on this to get it merged?
What is needed to get this merged in? Seems like it has been good to go for some years.
Why hasn't this been merged yet?
Any news on this one ?