Minit
Bun

method

async_hooks.HookCallbacks.init

asyncId: number,
type: string,
triggerAsyncId: number,
resource: object
): void;

Called when a class is constructed that has the possibility to emit an asynchronous event.

@param asyncId

A unique ID for the async resource

@param type

The type of the async resource

@param triggerAsyncId

The unique ID of the async resource in whose execution context this async resource was created

@param resource

Reference to the resource representing the async operation, needs to be released during destroy