method AsyncResource.prototype.runInAsyncScope
Jump to headingAsyncResource.prototype.runInAsyncScope<This,Result,>(fn: (this: This,...args: any[],) => Result,thisArg?: This,...args: any[],): ResultCall 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 Jump to heading
Jump to headingThisJump to headingResultParameters Jump to heading
Jump to headingfn: (this: This,...args: any[],) => ResultThe function to call in the execution context of this async resource.
optional
Jump to headingthisArg: ThisThe receiver to be used for the function call.
Jump to heading<span>...args</span>: any[]