Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capacity to set a default timeout on the client #164

Open
SBoudrias opened this issue Jul 16, 2015 · 3 comments
Open

Add capacity to set a default timeout on the client #164

SBoudrias opened this issue Jul 16, 2015 · 3 comments

Comments

@SBoudrias
Copy link

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)
@bpicolo
Copy link
Contributor

bpicolo commented Jul 17, 2015

+1

@analogue
Copy link
Contributor

This is currently a work in progress as an internal library. See y/retries_and_timeouts.

@analogue
Copy link
Contributor

Leaving open until a solution exists somewhere.

@analogue analogue reopened this Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants