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... - Наука
I finally understood! Thanks
Didn't know about that! Its super duper cool!
Very nicely explained
Very well explained
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?
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.
@@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?
@@26Anshu That's correct- you'll have to pass it.
Experiencing the same issue, frustrating that we need to propagate the store everywhere