Hold my context! - Miroslav Bajtoš | NodeConf EU 2022

Sdílet
Vložit
  • čas přidán 12. 10. 2022
  • Preserving contextual data across asynchronous calls has been always tricky in Node.js land. For example, how to pass information about the current user or a correlation (transaction) id from the code processing incoming HTTP requests to the code calling a backend web service? Traditional runtimes like C and Java can utilize thread-local storage, which does not work for Node's single-threaded event loop.
    The talk will describe different solutions people have been using (and abandoning) over the past 6+ years, dive into the history of domains and async hooks, and explain what's so difficult about context keeping. Finally, I'll discuss the AsyncLocalStorage API stabilized in Node.js 16 and show how to use it in practice.
    *****
    Miroslav Bajtoš is an experienced Node.js Engineer and alumnus of StrongLoop and IBM. For many years, he led the development of LoopBack.io, a popular open-source API framework for Node.js. Nowadays, he is working as an independent consultant helping companies to build Node.js backends integrating with legacy systems. In addition to being highly technical, Miroslav is also an experienced international speaker, having spoken at several Node.js conferences such as Global Summit for Node (2022), NodeSummit (2018), and NodeConf One-Shot London (2014) & Budapest (2014).
    *****
    Thank you to our sponsors:
    * NearForm
    * Charles River
    * web3.storage
    * Sidero
    * Google Cloud
    * Platformatic
    * Snyk
    * Bloomberg
    Visit: www.nodeconf.eu/
  • Věda a technologie

Komentáře •