Rust Async/Await
This cluster discusses the implementation, challenges, and usage of async/await in Rust, focusing on libraries like Tokio, executors, blocking operations, and comparisons to other languages.
Activity Over Time
Top Contributors
Keywords
Sample Comments
I believe I read that Tokio was a "hacky" way to add async to Rust - similar to the solution in the Python space... - is this not the case?
You can interoperate async and threads, but yes you have to tolerate having Tokio or similar as a dep
No without compiler support you can't do async in a library. Rust also does async in library so to speak.
Just to note the it's the same in Rust with tokio::spawn (and alternatives).
Not in Rust if you use something like Tokio.
I think the tokio library does this for rust
Rust 'async' frameworks allow you to issue blocking calls, either by auto-spawning a separate thread or on via a trivial executor that blocks on the current thread.
Those are async tasksOr rather -- async tasks are as close as you can get to green threads in rust without a runtime that would impose overhead on every program
It feels like you're complaining about things in the Rust language without taking the time to understand how the language idioms work. RTFM.Additionally, you're making snarky comments about how you don't like how the base language doesn't handle something like JS...then reference a third party JS library. Base JS doesn't solve your 'problem' either.To answer your question, async/await provides hooks for an executor (tokio being the most common) to ru
In Rust you use async/await with a scheduler like mio that will automatically do that for you as well.