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.

It looks like reqwest requires tokio - see here.


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

1 Like