Interesting. The whole async-await stuff has always been a bit risky to me (in any language), because yeah, as soon as you start introducing it, it spreads through your code base limitlessly.
This effort won’t yet quite fix that, but it will at least stop it from spreading under certain circumstances.I often like to use the actor pattern, which gives you relatively nice asynchronous code without language-level support, and well, that too spreads over your code base, but it spreads differently.
It requires core components to be turned into actors and communication between them needs to be done with messages instead of method calls, but on the plus side, within those actors, you write synchronous code, so utility functions and such don’t need to know about this async-vs-sync problem.So far, it always felt like this was just the better solution, if you were willing to pull through with the whole message-based communication. But yeah, I’m curious to see what the Rust team comes up with. If they can ‘fix’ async-await enough, maybe that’s worth another look.