• Ephera
    link
    fedilink
    arrow-up
    6
    ·
    2 years ago

    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.

    • jokeyrhymeOP
      link
      fedilink
      arrow-up
      3
      ·
      2 years ago

      Yeah, async/await in Rust is still one of those areas of least-comfort for me (especially since there’s enough runtime-specific code that it dictates the rest of your library choices)