Async Context Tracking in Node with Async Local Storage API ft. James Snell | JS Drops

Поделиться
HTML-код
  • Опубликовано: 14 фев 2023
  • In this JS Drop, James Snell goes over how Async Local Storage API works. He goes over the drawbacks of cascading functions for attaching information the traditional way, and why using Async Local Storage API (now stable) may be a more efficient use with Async Context Tracking.
    Follow James Snell on Twitter: / jasnell
    JS Drops offers bite sized tech content, presented by experts in the JavaScript ecosystem and beyond! Check in every Wednesday at 4:11PM ET for a brand new drop!
    JS Drops is presented by This Dot: www.thisdot.co/
    Follow This Dot Labs on Twitter: / thisdotlabs
    Follow This Dot Media on Twitter: / thisdotmedia
    Music Used: "EDM Detection Mode" Kevin MacLeod (incompetech.com)
    Licensed under Creative Commons: By Attribution 4.0 License
    creativecommons.org/licenses/b...
  • НаукаНаука

Комментарии • 9

  • @meowwyay
    @meowwyay 3 месяца назад

    I finally understood! Thanks

  • @otmanm4095
    @otmanm4095 Год назад +2

    Didn't know about that! Its super duper cool!

  • @johnm8358
    @johnm8358 Год назад +2

    Very nicely explained

  • @user-lw1rh4pk3e
    @user-lw1rh4pk3e Год назад

    Very well explained

  • @26Anshu
    @26Anshu Год назад

    Hi, In your example you have set and access the data within same class. What if we set data in one class and want to access it in another class function invoked from this class?

    • @ThisDotMedia
      @ThisDotMedia  Год назад

      Hi! As James mentions in the video at 14:45, so long as the ID provided by the declaration of new AsyncLocalStorage() can be shared with the functions, it would be possible.

    • @26Anshu
      @26Anshu Год назад

      @@ThisDotMedia So, I need to pass the sessionId while invoking the other class function. There is no way to access the data without passing it?

    • @ThisDotMedia
      @ThisDotMedia  Год назад

      @@26Anshu That's correct- you'll have to pass it.

    • @josht130
      @josht130 7 месяцев назад

      Experiencing the same issue, frustrating that we need to propagate the store everywhere