Skip to content

TaskRegistry

The task definitions the scheduler can run, looked up by name when a task is reserved. This simple registry holds tasks only; M5’s extension registry builds on the same shape and adds tools, sections and hot reload.

A task stays blocked, never failed, while its definition is missing, so installing one later wakes it up.

Since v0.0.0


Signature

declare class TaskRegistry

Source

Since v0.0.0

Signature

export interface TaskRegistryShape {
/** The installed definition with this name. */
readonly get: (name: string) => Option.Option<Task.Any>
/**
* Install definitions until the scope closes. Installing a name that is already installed replaces it, and closing
* the scope removes the definition again only if it is still the installed one. Listeners are told after each change.
*/
readonly install: (tasks: Iterable<Task.Any>) => Effect.Effect<void, never, Scope.Scope>
/** Call `listener` after every install or uninstall, until the scope closes. It must not throw or block. */
readonly subscribe: (listener: () => void) => Effect.Effect<void, never, Scope.Scope>
}

Source

Since v0.0.0

A registry holding tasks.

Signature

declare const layer: (tasks?: Iterable<Task.Any>) => Layer.Layer<TaskRegistry>

Source

Since v0.0.0

Install tasks into the registry in context for the lifetime of the layer.

Signature

declare const layerInstall: (tasks: Iterable<Task.Any>) => Layer.Layer<never, never, TaskRegistry>

Source

Since v0.0.0