News for hackers. Stuff that matters.
Re:Rust Starter Kit 2020 by Matthias247 on Sunday October 04, 2020 @05:54PM (#24682561)
Yes - really! It would be undefined behavior if the runtime doesn't make any promises about it. But some do make the promises that it will work. I think both async-std and tokio make sure IO related futures work from tasks that are driven by a different runtime - otherwise stuff like `future::executor::block_on(task)` would also not work, and neither would the blocking wrappers around some of the HTTP clients.

However the IO objects might need to be initialized within a certain context (e.g. some TLS variables need to be set for tokio). And there might be a few different things one need watch out for. E.g. if you stop the background runtime things might get weird - however this e.g. can't happen with async-std since the background runtime will never shut down.

Re:Rust Starter Kit 2020 by wokwokwok on Sunday October 04, 2020 @07:45PM (#24683163)
I couldn’t find any docs on this, got a link by any chance?

Specifically where tokio commits to working with other runtimes.

Re:Rust Starter Kit 2020 by _hrfd on Tuesday October 06, 2020 @06:25AM (#24696302)
Re:Rust Starter Kit 2020 by wokwokwok on Tuesday October 06, 2020 @07:37AM (#24696652)
This seems unrelated.

Some arbitrary 3rd party wrapper does not make any guarantees about the runtimes it wraps.

This is just more “happens to work at the moment”.