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

    Function run

    • This is the central function that kicks off your runner. You can run as many resources as you want in a single process, they will run in complete isolation.

      Type Parameters

      • C
      • V extends Promise<any>

      Parameters

      • resourceOrResourceWithConfig:
            | IResourceWithConfig<
                C,
                V,
                any,
                any,
                any,
                TagType[],
                IResourceMiddleware<any, void, void, any>[],
            >
            | IResource<
                void,
                V,
                any,
                any,
                any,
                TagType[],
                ResourceMiddlewareAttachmentType[],
            >
            | IResource<
                { [key: string]: any; [key: number]: any; [key: symbol]: any },
                V,
                any,
                any,
                any,
                TagType[],
                ResourceMiddlewareAttachmentType[],
            >

        The resource or resource with config to run.

      • Optionaloptions: RunOptions

        The options for the run.

      Returns Promise<RunResult<V extends Promise<U> ? U : V>>

      A promise that resolves to the result of the run.

      import { r, run } from "@bluelibs/runner";

      const app = r.resource("app")
      .register([myTask, myService])
      .build();

      const runtime = await run(app);
      await runtime.runTask(myTask, { name: "Ada" });
      await runtime.dispose();