News for hackers. Stuff that matters.
Re:Await in Rust by Tuna-Fish on Monday August 12, 2019 @11:59AM (#20676635)
> How do you deal with a situations when you have non-async/await code, and then you need to call just one function, which happened to be "async"

This depends on what do you want to happen. Do you want to block on the one async function, or do you want to turn your current function into async and propagate the asyncness to your caller?

Both options are available to you in Rust.

Re:Await in Rust by ummonk on Monday August 12, 2019 @12:29PM (#20676962)
I think the people criticizing it are, like me, coming from other languages where blocking on async doesn't make your function sync. The asyncness still ends up propagating to the caller function in such languages.
Re:Await in Rust by Tuna-Fish on Monday August 12, 2019 @12:44PM (#20677173)
Thank you for putting it explicitly, everything here suddenly makes so much more sense.

But yes, in Rust async is not a plague that irredeemably taints everything. You can choose to use anything that is async synchronously if you choose to, just by calling .poll() on the future at the callsite.