4 ms·
what's the modern "absolute beginner's guide to async in Rust" - ideally something dense that can bring someone motivated from beginner to expert in ~1 week of
by dragochat 5mo ago
what's the modern "absolute beginner's guide to async in Rust" - ideally something dense that can bring someone motivated from beginner to expert in ~1 week of intense hacking on it?
- lame_lexem 5mo agothere is a chapter on async in comprehensive rust and rustbook which ought to bring you up to speed there is the async book but it is largely unfinished you can watch John Gjengset's crust of rust async, decrusting tokio, and why what, and how of pinning in rust then there are tokio-lessons and tokio tutorial which teach how to use tokio runtime and there are also good blogposts by phil-oop and rose wright on how async works https://doc.rust-lang.org/book/ch17-00-async-await.html https://doc.rust-lang.org/book/ch17-00-async-await.html https://google.github.io/comprehensive-rust/concurrency/welcome-async.html https://google.github.io/comprehensive-rust/concurrency/welc... https://rust-lang.github.io/async-book/intro.html https://rust-lang.github.io/async-book/intro.html https://youtu.be/ThjvMReOXYM https://youtu.be/ThjvMReOXYM https://youtu.be/o2ob8zkeq2s https://youtu.be/o2ob8zkeq2s https://youtu.be/DkMwYxfSYNQ https://youtu.be/DkMwYxfSYNQ https://github.com/freddiehaddad/tokio-lessons https://github.com/freddiehaddad/tokio-lessons https://tokio.rs/tokio/tutorial https://tokio.rs/tokio/tutorial https://os.phil-opp.com/async-await/ https://os.phil-opp.com/async-await/ https://dev.to/rosewrightdev/from-futures-to-runtimes-how-async-rust-actually-works-4gec https://dev.to/rosewrightdev/from-futures-to-runtimes-how-as...
- dana321 5mo agoIt doesn't take a week to learn the async basics. add async keyword to functions add .await when calling them use tokio in your main function (easy to look up) use the async recursion crate if you need to use recursion but don't want to box everything There are some bonuses like calling functions in parallel, but there you go.
- usrnm 5mo agoAnd then you want to do something trivial like an async callback
- dragochat 5mo ago> trivial like an async callback can't for the love of dog parse the meaning of this - what do you mean? a callback that is async passed to a sync api? you refer to the complexity of sync<->async bridging? ...or?
- usrnm 5mo agoJust pass it around, store it and then call it. What type does it have? AsyncFn is still an experimental API.