Node.js · Senior · Question 69 of 75

Why can AsyncLocalStorage lose its context inside some libraries, and what fixes it?

Explanation

Context follows the async chain where a callback was created. A pool that runs a stored callback later continues the chain of whoever triggered it, not the original request.

Further reading

Problem with a question

Node.js · Senior · question 69

Test yourself

Take the Node.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz