When you've got a Node daemon with so much weird async shit going on you practically need a flux capacitor to sort out if all those promises get resolved in the order you need them to resolve.

  • 1
    Nested await...xD
  • 2
    You need some Rx 😉
  • 0
    ..... what? Do you not use await?

    How can you possibly have this problem if you understand javascript?
  • 0
    It's C++, not Javascript, but Eric describes the problem of how async code devolves into spaghetti because control flow and object lifetimes are wildly decoupled.

    For C++ the solution is co-routines.


    (Edit: I have only slightly more than zero experience with Javascript though, so I have no idea how well or not JS coroutines address this problem.)
  • 1
    @halfflat Async code in C++ != what people mean by "async" in javascript.

    Coroutines do what "async" code does in javascript. And yes, coroutines will certainly solve this problem (I'm working with C++ coroutines as we speak).
Add Comment