AsyncResource

constructor(type: String)(source)
constructor(type: String, triggerAsyncId: Double = definedExternally)(source)
constructor(type: String, triggerAsyncId: AsyncResourceOptions = definedExternally)(source)

AsyncResource() is meant to be extended. Instantiating a new AsyncResource() also triggers init. If triggerAsyncId is omitted then async_hook.executionAsyncId() is used.

Parameters

type

The type of async event.

triggerAsyncId

The ID of the execution context that created this async event (default: executionAsyncId()), or an AsyncResourceOptions object (since v9.3.0)