Node.js AsyncLocalStorage Explained in 84.3 seconds

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

this is handy, however, if I'm understanding correctly, this would remove idempotency from your functions, which is a tradeoff like everything else.

I like the context idea, might make it easier to test too

Thanks for the vid! 🎉

carlosconejo
Автор

Interesting. Never heard of that. Looks like node's still has some interesting tricks

gilbertsenyonjo
Автор

Woww. Best explanation ever. Thanks Wes Bos!

gilbertsenyonjo
Автор

I‘m wondering if it would be possible to implement the same behavior with ES6. The storage object must have some kind of a register with the different states from the different stacks it started from. The function „three“, when called asynchronously, must then be able to be identified with it‘s origin stack (id) in order to get the right „register“ from the storage object when calling „getStorage“. While writing this, it seems not possible to do with the current available features (e.g. ES6).

arber
Автор

What's the difference with a global variable?

hfyaer
Автор

Bro, try to use a lower voice, that intro is insane..

doyourthing