Skip to main content
HookCallbacks.init - node__async_hooks.d.ts - Node documentation
method HookCallbacks.init

Usage in Deno

```typescript import { type HookCallbacks } from "node:node__async_hooks.d.ts"; ```
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.

Parameters

asyncId: number
A unique ID for the async resource
type: string
The type of the async resource
triggerAsyncId: number
The unique ID of the async resource in whose execution context this async resource was created
resource: object
Reference to the resource representing the async operation, needs to be released during destroy

Return Type

void