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

Support timeouts #36

Closed
matthewkmayer opened this issue Dec 24, 2016 · 1 comment
Closed

Support timeouts #36

matthewkmayer opened this issue Dec 24, 2016 · 1 comment

Comments

@matthewkmayer
Copy link

First, thank you for this higher level crate, it's appreciated!

We're looking at switching from hyper's client to reqwest in Rusoto which will be nice to avoid openssl issues and make our code more concise. We use the set_read_timeout of hyper's client in a couple spots to avoid waiting around too long.

Are there plans for adding this to reqwest? At first glance adding it to RequestBuilder would be a good spot. I've not looked at much of the reqwest code to see how it'd be added, though.

Rusoto use of set_read_timeout is here.

@seanmonstar
Copy link
Owner

I would definitely like to support timeouts. When looking at something like golang's HTTP Client, it only provides a single timeout, which acts more like a deadline for the whole operation. If you set the timeout to 20 seconds, if the combined operations take longer than 20 seconds, you will receive a timeout error. I feel that this functionality is more often expected from people, instead of how hyper currently does it, which is a timeout per read/write, meaning a very slow connection could still take minutes to complete.

Unfortunately, it is not possible to enforce this kind of timeout using hyper 0.9, because of its use of blocking IO. Once hyper 0.10 is released, this will be possible. I'm not quite sure how I should expose timeouts until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants