You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thank you for all of your hard work on this crate - it is a pleasure to use.
My use case is posting requests to a remote API, where the request body and response body can vary widely, from a few kilobytes to tens of megabytes. This makes it difficult to determine an appropriate timeout for each request. I thought about setting the request timeout based on the size of the request body and some conservative estimate of a user's line speed, but it looks like the timeout that is set on the request will also apply as the response body is being read out (#502). If I've read the code correctly I could work around that by streaming the body and applying my own timeout, but I find myself wondering if there is an easier way.
Is there a way to specify a timeout on the socket read/write instead? In this case I'm not so concerned with the total amount of time taken, but simply if progress is being made or not, as that way I can avoid connections getting stuck, while not timing out unnecessarily for users with slow connections. Any suggestions you might have would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
The hyper-timeout crate appears to enable this, but to add it in client code, reqwest would need to support a generic impl Connector being passed in, instead of hard-coding the use of Connector. Is there any interest in merging such an approach? For now I'll just use a custom version, but it would be great if this didn't require forking in the future.
dae
added a commit
to ankitects/anki
that referenced
this issue
Aug 21, 2020
Hi there,
Firstly, thank you for all of your hard work on this crate - it is a pleasure to use.
My use case is posting requests to a remote API, where the request body and response body can vary widely, from a few kilobytes to tens of megabytes. This makes it difficult to determine an appropriate timeout for each request. I thought about setting the request timeout based on the size of the request body and some conservative estimate of a user's line speed, but it looks like the timeout that is set on the request will also apply as the response body is being read out (#502). If I've read the code correctly I could work around that by streaming the body and applying my own timeout, but I find myself wondering if there is an easier way.
Is there a way to specify a timeout on the socket read/write instead? In this case I'm not so concerned with the total amount of time taken, but simply if progress is being made or not, as that way I can avoid connections getting stuck, while not timing out unnecessarily for users with slow connections. Any suggestions you might have would be greatly appreciated.
The text was updated successfully, but these errors were encountered: