@bluelibs/runner - v6.3.1
    Preparing search index...

    Interface IRuntime<V>

    Common interface for the Runner runtime instance. Provides access to tasks, events, resources, and lifecycle management.

    interface IRuntime<V = unknown> {
        root: IResource<any, Promise<V>, any, any, any>;
        runOptions: ResolvedRunOptions;
        state: RuntimeState;
        dispose(options?: RuntimeDisposeOptions): Promise<void>;
        emitEvent<P>(
            event: string | IEvent<P>,
            payload?: P extends void | undefined ? undefined : P,
            options?: IEventEmitOptions,
        ): Promise<void | IEventEmitReport>;
        getHealth(
            resourceDefs?: (
                | string
                | IResource<
                    any,
                    any,
                    any,
                    any,
                    any,
                    ResourceTagType[],
                    ResourceMiddlewareAttachmentType[],
                >
            )[],
        ): Promise<IResourceHealthReport>;
        getLazyResourceValue<Output extends Promise<any>>(
            resource:
                | string
                | IResource<
                    any,
                    Output,
                    any,
                    any,
                    any,
                    ResourceTagType[],
                    ResourceMiddlewareAttachmentType[],
                >,
        ): Promise<Output extends Promise<U> ? U : Output>;
        getResourceConfig<Config>(
            resource:
                | string
                | IResource<
                    Config,
                    any,
                    any,
                    any,
                    any,
                    ResourceTagType[],
                    ResourceMiddlewareAttachmentType[],
                >,
        ): Config;
        getResourceValue<Output extends Promise<any>>(
            resource:
                | string
                | IResource<
                    any,
                    Output,
                    any,
                    any,
                    any,
                    ResourceTagType[],
                    ResourceMiddlewareAttachmentType[],
                >,
        ): Output extends Promise<U> ? U : Output;
        pause(reason?: string): void;
        recoverWhen(options: IRuntimeRecoveryOptions): IRuntimeRecoveryHandle;
        resume(): void;
        runTask<
            TTask extends
                | string
                | ITask<
                    any,
                    Promise<any>,
                    any,
                    any,
                    TaskTagType[],
                    TaskMiddlewareAttachmentType[],
                >,
        >(
            task: TTask,
            ...args: TTask extends ITask<
                I,
                any,
                any,
                any,
                TaskTagType[],
                TaskMiddlewareAttachmentType[],
            >
                ? I extends void
                | undefined
                    ? [input?: I, options?: TaskCallOptions]
                    : [input: I, options?: TaskCallOptions]
                : [input?: unknown, options?: TaskCallOptions],
        ): TTask extends ITask<
            any,
            O,
            any,
            any,
            TaskTagType[],
            TaskMiddlewareAttachmentType[],
        >
            ? O
            : Promise<any>;
    }

    Type Parameters

    • V = unknown

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    root: IResource<any, Promise<V>, any, any, any>

    Root resource definition for this runtime.

    runOptions: ResolvedRunOptions

    Normalized run() options captured for this runtime instance.

    Current admission state for new work.

    Methods

    • Stops admitting new external work while allowing active work to continue.

      Parameters

      • Optionalreason: string

      Returns void

    • Re-opens admissions immediately and clears the active recovery episode.

      Returns void