Bun

interface

async_hooks.HookCallbacks

interface HookCallbacks

  • asyncId: number
    ): void;

    Called immediately after the callback specified in before is completed.

    If an uncaught exception occurs during execution of the callback, then after will run after the 'uncaughtException' event is emitted or a domain's handler runs.

    @param asyncId

    the unique identifier assigned to the resource which has executed the callback.

  • asyncId: number
    ): void;

    When an asynchronous operation is initiated or completes a callback is called to notify the user. The before callback is called just before said callback is executed.

    @param asyncId

    the unique identifier assigned to the resource about to execute the callback.

  • asyncId: number
    ): void;

    Called after the resource corresponding to asyncId is destroyed

    @param asyncId

    a unique ID for the async resource

  • 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

  • asyncId: number
    ): void;

    Called when a promise has resolve() called. This may not be in the same execution id as the promise itself.

    @param asyncId

    the unique id for the promise that was resolve()d.