AsyncResource() is meant to be extended. Instantiating a new AsyncResource() also triggers init. If triggerAsyncId is omitted then async_hook.executionAsyncId() is used.
constructor
async_hooks.AsyncResource.constructor
Not implemented in Bun
constructor AsyncResource(
type: string,
@param type
The type of async event.
@param triggerAsyncId
The ID of the execution context that created this async event (default: executionAsyncId()
), or an AsyncResourceOptions object (since v9.3.0)