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
The ClientBuilder::timeout() option describes a timeout for the entire request and response. Also considered a deadline. So, if you set the timeout to 30 seconds, if the full response hasn't finished after 30s, the streaming will error. However, many times that's not what is wanted. Many would like a timeout to detect a stalled download, but can't know ahead of time how big the download is.
Solution: add ClientBuilder::read_timeout(Duration), which is a recurring timeout for each read operation. Basically, if you set the read_timeout to 30s, it will wait up to 30s for the response headers. Then, each chunk of the body gets a new slice of 30 seconds.
Implementation wise, this can make use of the TimeoutBody type in tower-http, internally inside Response, if the timeout is set.
The text was updated successfully, but these errors were encountered:
The
ClientBuilder::timeout()
option describes a timeout for the entire request and response. Also considered a deadline. So, if you set the timeout to 30 seconds, if the full response hasn't finished after 30s, the streaming will error. However, many times that's not what is wanted. Many would like a timeout to detect a stalled download, but can't know ahead of time how big the download is.Solution: add
ClientBuilder::read_timeout(Duration)
, which is a recurring timeout for each read operation. Basically, if you set the read_timeout to 30s, it will wait up to 30s for the response headers. Then, each chunk of the body gets a new slice of 30 seconds.Implementation wise, this can make use of the
TimeoutBody
type in tower-http, internally insideResponse
, if the timeout is set.The text was updated successfully, but these errors were encountered: