-
Notifications
You must be signed in to change notification settings - Fork 138
[DNM] [5.0.x] Replace custom hyper client with reqwest #520
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
Conversation
This seems a great improvement 👍 .
Sure ping me anytime! |
For some reason the tests are failing on Windows, I will try to debug it on my machine after the weekend as I don't have access to it before then. |
Looks like a random error. I triggered another run. |
This seems good, any other issues with this PR? Can we merge it now? |
@quentinlesceller can we close this one? |
Yes indeed we can close this one. |
Right now our HTTP client that interfaces with the node and other wallets is using some pretty low level hyper code. It uses separate dependencies for tls and timeouts. On top of that, it uses a Tokio runtime that is spun up for every request separately, which is inefficient and tends to fail at some point (see #509).
This PR replaces the hyper code by the reqwest library, which is well reviewed and maintained and using it simplifies our code.
Instead of creating a tokio runtime for each request, use a global runtime. Unfortunately, until reqwest updates to tokio 0.3, the runtime will have to be behind a
Mutex
.