Metreeca Gear
    Preparing search index...

    Module index

    Job executor and service locator.

    Provides the runtime for executing jobs, together with the shared services they rely on.

    Service location keeps a job independent of the facilities it uses: a job names a facility by its default service rather than importing a concrete implementation, and a binding substitutes another one for the duration of an execution, leaving unbound facilities to fall back on their own default; custom facilities honouring the same contracts plug in interchangeably.

    Important

    Service instances are constructed on first use, shared across the job, and, where they implement a disposal protocol, disposed as it ends. Concurrent or repeated runs share nothing.

    await executor(

    bind(createVault, createEnvVault)

    )(async () => {

    console.log(await service(createVault)("key"));

    });
    Executor

    Job executor.

    Executable

    Executable job.

    Binding

    Service binding.

    Service

    Service factory.

    executor

    Creates a job executor.

    bind

    Binds an implementation to a service.

    service

    Resolves a service.