asyncHooksMod
Type members
Classlikes
When having multiple instances of AsyncLocalStorage
, they are independent
from each other. It is safe to instantiate this class multiple times.
When having multiple instances of AsyncLocalStorage
, they are independent
from each other. It is safe to instantiate this class multiple times.
The class AsyncResource was designed to be extended by the embedder's async resources. Using this users can easily trigger the lifetime events of their own resources.
The class AsyncResource was designed to be extended by the embedder's async resources. Using this users can easily trigger the lifetime events of their own resources.
- Companion
- object
Value members
Concrete methods
Registers functions to be called for different lifetime events of each async operation.
Registers functions to be called for different lifetime events of each async operation.
- Value Params
- options
the callbacks to register
- Returns
an AsyncHooks instance used for disabling and enabling hooks
Returns the asyncId of the current execution context.
Returns the asyncId of the current execution context.
The resource representing the current execution. Useful to store data within the resource.
The resource representing the current execution. Useful to store data within the resource.
Resource objects returned by executionAsyncResource()
are most often internal
Node.js handle objects with undocumented APIs. Using any functions or properties
on the object is likely to crash your application and should be avoided.
Using executionAsyncResource()
in the top-level execution context will
return an empty object as there is no handle or request object to use,
but having an object representing the top-level can be helpful.