News for hackers. Stuff that matters.
Re:Tokio 1.0 – async runtime for Rust by brobinson on Wednesday December 23, 2020 @03:58PM (#25522142)
The tokio tutorial is good, but it needs an example of spinning off multiple (2-3 or more) tasks which run forever. I ended up using spawn() multiple times and having the main thread just sleep in a loop and not using #[tokio::main] because I couldn't figure it out.
Re:Tokio 1.0 – async runtime for Rust by aliceryhl on Wednesday December 23, 2020 @04:05PM (#25522222)
You can await std::future::pending, or you can just await the Join Handles returned by the calls to spawn.
Re:Tokio 1.0 – async runtime for Rust by brobinson on Wednesday December 23, 2020 @05:12PM (#25522870)
Thanks for the tip!