Skip to content

RunWithRequestContainerOptions · Node.js API

type RunWithRequestContainerOptions<TResult> = object;

Options for running work inside an AsyncLocalStorage-backed child container.

Type Parameter

TResult

readonly optional providers?: readonly Provider[];

Extra providers registered only for this request container.


readonly run: (container) => TResult | Promise<TResult>;

Work that runs inside the current async request scope. Await all work that reads the request container before this callback settles. Deferred work, such as a Next.js after callback, must enter a fresh request scope.

Parameter Type

container

Container

TResult | Promise<TResult>