News for hackers. Stuff that matters.
Re:A four year plan for async Rust by littlestymaar on Tuesday November 07, 2023 @11:52AM (#38179207)
Yes this works too. People complaining about async being contaminant are often so much prejudiced against it that that haven't even tried to understand the basics.
Re:A four year plan for async Rust by dymk on Tuesday November 07, 2023 @11:54AM (#38179256)
I have plenty of gripes about async in rust, but one of the things it's surprisingly good at is isolation of async runtimes. There's no reason you can't have multiple tokio runtimes, or transient runtimes, in your application.

Now if only the other warts were fixed, like the particularly poor compiler errors when there's an issue within an async function...

Re:A four year plan for async Rust by tuetuopay on Tuesday November 07, 2023 @12:25PM (#38179798)
Yup. I was blown away when I spun up five different tokio runtimes in the same app all communicating through channels. I expected at least the tokio-aware channels to be problematic but not in the slightest. It's now humming in prod doing its business. Once you get the basics, it's quite easy to lego stuff out and get the best of both worlds.
Re:A four year plan for async Rust by LtWorf on Tuesday November 07, 2023 @01:07PM (#38180466)
Having written an async library (as in, the non-blocking stuff and state, that to the caller looks like async)... Understanding it isn't the easiest.
Re:A four year plan for async Rust by mplanchard on Tuesday November 07, 2023 @01:21PM (#38180686)
Yeah writing the underlying machinery is definitely much more complicated! Most users of async libraries don't need to worry about this though