/

Hold my context!

Copy Link

Unlock This Lesson

23

min

Hold my context!

Hold my context!

Hold my context!

Hold my context!

publish date

Jun 8, 2022

duration

23

min

Difficulty

Intermediate

Beginner

Beginner

Beginner

Case details

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, explain what's so difficult about context keeping. Finally, I'll discuss the AsyncLocalStorage API introduced by Node.js 14 and show how to use it in practice.

Share case:

Questions?

Chat with Us!

910 Foulk Road, Suite 201

Wilmington, DE 19803, USA

© 2025 Geekle. All rights reserved.

Questions?

Chat with Us!

910 Foulk Road, Suite 201

Wilmington, DE 19803, USA

© 2025 Geekle. All rights reserved.

Questions?

Chat with Us!

910 Foulk Road, Suite 201

Wilmington, DE 19803, USA

© 2025 Geekle. All rights reserved.

Questions?

Chat with Us!

910 Foulk Road, Suite 201

Wilmington, DE 19803, USA

© 2025 Geekle. All rights reserved.