Open
Description
What is the problem this feature will solve?
Currently I would like to store in AsyncLocalStorage
an object that requires clean up. It is a MongoDB session, after the async chain is finished I should execute session.endSession
. I have no way to listen when the AsyncLocalStorage is going to be destroyed and execute my clean operation.
What is the feature you are proposing to solve the problem?
I propose the adding a callback argument to the AsyncLocalStorage.run
function to be executed at the end of the async chain started there.
What alternatives have you considered?
I've tried using AsyncHooks to try to achieve this but I've unable to achieve this reliably.
Metadata
Metadata
Assignees
Type
Projects
Status