Hacker News new | ask | show | jobs
by davidatbu 1359 days ago
So, does this work with an application that uses tokio?
1 comments

This uses the executor used by async-std rather than the one used by Tokio. So if you're using something Tokio-specific, you would probably need async-compat[1].

But can you share more on what you need Tokio for? I'd completely understand if we're working with servers. But when it come to clients - UI applications - I feel like async-std and smol are pretty competitive.

[1]: https://docs.rs/async-compat/

>But can you share more on what you need Tokio for?

Because everything. uses. Tokio. It's become the defacto standard of async Rust, whether people like it or not.

This issue has been notable enough to cause some projects to outright consider dropping async-std support - and I think they only relented because there's apparently enough (private, not-open-source) users who apparently still use it.

(https://github.com/launchbadge/sqlx/issues/1669)

(Note that they also have a note about async-compat not exactly being an ideal solution and that they'd be looking into writing their own)

`reqwest` comes to mind as a client-side library that's my goto, that I think is tokio-only?

But I think the distinction you made about "client-side Rust" not being as obviously-tokio-dominated as backend-side does make me stop and think.

Btw, this looks interesting regardless! Great job! Can I ask how your Rust learning journey went? I assume one needs an under-the-hood understanding of async Rust to build a library like this, and I'd love to hear about your learning journey getting to that understanding.