Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Methods

asyncId

  • asyncId(): number
  • Returns number

    the unique ID assigned to this AsyncResource instance.

disconnect

  • disconnect(): void
  • Disconnects the PerformanceObserver instance from all notifications.

    Returns void

emitDestroy

  • emitDestroy(): void
  • Call AsyncHooks destroy callbacks.

    Returns void

observe

  • observe(options: object): void
  • Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes. When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance. Property buffered defaults to false.

    Parameters

    • options: object
      • Optional buffered?: undefined | false | true
      • entryTypes: string[]

    Returns void

runInAsyncScope

  • runInAsyncScope<This, Result>(fn: function, thisArg?: This, ...args: any[]): Result
  • Call the provided function with the provided arguments in the execution context of the async resource. This will establish the context, trigger the AsyncHooks before callbacks, call the function, trigger the AsyncHooks after callbacks, and then restore the original execution context.

    Type parameters

    • This

    • Result

    Parameters

    • fn: function

      The function to call in the execution context of this async resource.

        • (this: This, ...args: any[]): Result
        • Parameters

          • this: This
          • Rest ...args: any[]

          Returns Result

    • Optional thisArg: This

      The receiver to be used for the function call.

    • Rest ...args: any[]

      Optional arguments to pass to the function.

    Returns Result

triggerAsyncId

  • triggerAsyncId(): number
  • Returns number

    the trigger ID for this AsyncResource instance.

Generated using TypeDoc