Usage with async-std
?
#1676
-
I'm working on a codebase which uses a lot of I now need to make a few http requests, and thread 'webcal::test::test_dummy' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime', /home/hugo/.local/state/cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.23/src/client/connect/dns.rs:121:24
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace The message is pretty clear: I must be using tokio to use reqwests. However, I can't use tokio because that would require re-writing everything I already have using async-std (and a lot of the functionality isn't even available in tokio). As far as I understand, Is it somehow possible to use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
This is the first I've heard this. Tokio is significantly more common, and so I'd expect the opposite to be the case.
reqwest is opinionated, and chooses to work specifically with Tokio (and WASM as an alternative). |
Beta Was this translation helpful? Give feedback.
-
You're actually right, it does seem to support everything I need. And its API matches the std one too. I think my familiarity with this has aged poorly; I'll give |
Beta Was this translation helpful? Give feedback.
This is the first I've heard this. Tokio is significantly more common, and so I'd expect the opposite to be the case.
reqwest is opinionated, and chooses to work specifically with Tokio (and WASM as an alternative).