@bluelibs/runner - v5.5.0
    Preparing search index...

    Interface IAsyncContext<T>

    The generic AsyncContext object returned by defineAsyncContext.

    interface IAsyncContext<T> {
        "[symbolAsyncContext]": true;
        "[symbolFilePath]": string;
        id: string;
        optional(): IOptionalDependency<IAsyncContext<T>>;
        parse(data: string): T;
        provide<R>(value: T, fn: () => R | Promise<R>): R | Promise<R>;
        require(): ITaskMiddlewareConfigured<{ context: IAsyncContext<T> }>;
        serialize(data: T): string;
        use(): T;
    }

    Type Parameters

    • T
    Index

    Properties

    "[symbolAsyncContext]": true

    Brand marker for registration and runtime checks

    "[symbolFilePath]": string

    File path where this async context was defined

    id: string

    unique symbol used as key in the AsyncLocalStorage map

    Methods

    • Provide a value for this context during the lifetime of fn()

      Type Parameters

      • R

      Parameters

      • value: T
      • fn: () => R | Promise<R>

      Returns R | Promise<R>