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

Middleware wrappers for reqwest::Response #57

Open
adensur opened this issue Aug 31, 2022 · 1 comment
Open

Middleware wrappers for reqwest::Response #57

adensur opened this issue Aug 31, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@adensur
Copy link

adensur commented Aug 31, 2022

There is currently no wrapper for reqwest::Response. As a result, resp.body().await? call is not retried. In the case where the response is large, resp.body() call involves a lot of tcp socket listening and can potentially throw network errors

@adensur adensur added the enhancement New feature or request label Aug 31, 2022
@conradludgate
Copy link
Collaborator

From what I understand about this issue, you want to be able to retry the response body? As far as I'm aware, it's not possible to do so without making a full new request again.

This would require the Response to carry around the Client and Request structs with it. I'm not sure if I like that being a default behaviour.

Perhaps I could interest you in https://docs.rs/futures-retry-policies/0.2.2/futures_retry_policies/ instead? It's a library I made using the same RetryPolicy types in order to retry arbitrary async functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants