(no title)
whytevuhuni | 3 months ago
Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.
https://play.rust-lang.org/?version=stable&mode=debug&editio...
thinkharderdev|2 months ago
dwattttt|2 months ago
https://play.rust-lang.org/?version=stable&mode=debug&editio...
tcfhgj|3 months ago
also: spawn_blocking for blocking code
whytevuhuni|3 months ago
You might be different, and you might start doing that in your code, but almost none of either std or 3rd party libraries will cooperate with you.
The difference with Zig is not in its capabilities, but rather in how the ecosystem around its stdlib is built.
The equivalent in Rust would be if almost all I/O functions in std would be async; granted that would be far too expensive and disruptive given how async works.