Why should not use EventEmitter for Asynchronous Operations

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ส.ค. 2024
  • This video investigates why using EventEmitter with an async function is an anti-pattern. Are you using this pattern? Let me know in the comments.
  • บันเทิง

ความคิดเห็น • 7

  • @_benlesh
    @_benlesh 11 หลายเดือนก่อน +5

    🤯TIL that EventEmitter is fundamentally broken, actually, by what is called "producer interference". It basically breaks the loop that is notifying consumers when any one of those consumers synchronously errors. This is something we fixed about Observable (and Subject) years ago because of debate in the TC39 about behavior. We shouldn't be able to `try/catch` over an `emit`. That's bad....
    Amazing video, Matteo, thanks!

  • @augustin_
    @augustin_ 11 หลายเดือนก่อน +2

    Oh super vidéo. Thanks Matteo !

  • @kosson
    @kosson 11 หลายเดือนก่อน +1

    Super! I learned a lot. Thank you!

  • @famrossignon
    @famrossignon 10 หลายเดือนก่อน +1

    This could be called "Why should not use Asynchronous Operations inside EventEmitter event handlers"

    • @adventuresinnodeland
      @adventuresinnodeland  8 หลายเดือนก่อน

      Indeed! Things can be even more tricky, new video will come soon!

  • @kid1412621
    @kid1412621 หลายเดือนก่อน

    So the event emitter is designed for async purpose, not async usage?