shultz
shultz9mo ago

Async execution context

Is there any way I can create a global that is unique to an async operation? I would like to use that for logging operation context. Or maybe just a built in way to get some kind ID of the current operation, as in for each task in the event loop getting a different ID, than I can use regular module context with the ID.
2 Replies
Andreu Botella (they/them)
IIRC you can use Node.js's AsyncLocalStorage in Deno I think that does what you need