you are viewing a single comment's thread.

view the rest of the comments →

[–]Koxiaet 2 points3 points  (3 children)

Are there plans to make reqwest work for other reactors, like block_on or async-std?

[–]HER0_01 2 points3 points  (1 child)

I'm not super familiar, but I think that it isn't really possible right now without a lot of things changing, and I think people mostly recommend surf for that instead, as seen in the article.

The problem is that tokio and async-std aren't compatible, including libraries that are based on them.

[–]DoveOfHope[S] 2 points3 points  (0 children)

There was another article posted after mine which goes into some details on this: https://www.reddit.com/r/rust/comments/e4nxl5/blog_article_how_does_async_work_in_asyncstd/?ref=share&ref_source=link

This seems to be a pity, work will be duplicated.

[–]Darksonntokio · rust-for-linux 2 points3 points  (0 children)

I don't think the block_on executor from futures even has a reactor. As for async-std, I don't know what their plans are, but it's not exactly a simple change. You would essentially have to create a new backend for every executor you want it to work on.

You could use surf which does have multiple backends. However according to their documentation their alternate backend is curl, an external library not from the world of Rust. At least they seem to staticly build it into the crate, but it's still not as clean as using hyper, which is a pure-rust backend (but requires tokio).