Trying async-std as alternative to tokio

I like tokio just fine, but I want to learn how to use async-std as an alternative.
Here is some code that works fine with tokio.
I commented out all the tokio parts and added corresponding code for async-std.
But when I run it I get the runtime error "thread 'main' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime'".
It's a mystery to me how it even knows that tokio exists because I commented out everything related to that.

https://github.com/mvolkmann/rust-web-scrape/blob/master/src/main.rs#L2

It looks like reqwest requires tokio - see here.

2 Likes

I’ve never used it but surf is an async-std compatible http client.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.