bravado
bravado copied to clipboard
Add capacity to set a default timeout on the client
By default, the .result() timeout is 5 seconds. This is pretty high and we'll usually overwrite it to be much lower in real case scenario (client.foo.get().result(timeout=0.5)). This is making most call to any endpoint pretty verbose.
I feel it'd make code more readable if we could just define a lower timeout value by default on the client.
Api suggestion:
client = SwaggerClient.from_url("http://petstore.swagger.io/v2/swagger.json", timeout=0.5)
client = SwaggerClient.from_url("http://petstore.swagger.io/v2/swagger.json").setDefaultTimeout(0.5)
+1
This is currently a work in progress as an internal library. See y/retries_and_timeouts.
Leaving open until a solution exists somewhere.