Skip to content

@usine/engine/loop-control

Records whether triggers may open new Runs for each Loop; existing Runs and authored files stay unchanged.

  • Context.ServiceClass

readonly Service: object

The service’s operations: what yield* LoopControl returns.

readonly isPaused: (loop) => Effect.Effect<boolean, EnginePersistenceError>

Whether new Runs are paused; a Loop with no recorded runtime state is unpaused.

Parameter Type
loop LoopName

Effect.Effect<boolean, EnginePersistenceError>

readonly pause: (loop) => Effect.Effect<LoopRuntimeState, EnginePersistenceError>

Pauses new trigger work for this Loop without stopping its existing Runs.

Parameter Type
loop LoopName

Effect.Effect<LoopRuntimeState, EnginePersistenceError>

readonly states: Effect.Effect<ReadonlyArray<LoopRuntimeState>, EnginePersistenceError>

Recorded runtime states ordered by Loop name; Loops without stored state are omitted.

readonly unpause: (loop) => Effect.Effect<LoopRuntimeState, EnginePersistenceError>

Allows triggers to open new Runs for this Loop again.

Parameter Type
loop LoopName

Effect.Effect<LoopRuntimeState, EnginePersistenceError>

readonly static layer: Layer<LoopControl, never, RunDatabase>


Runtime state for one Loop. Authored loop files never carry this toggle.

  • Schema.Class

new LoopRuntimeState(…args): LoopRuntimeState

Parameter Type
…args [props: object, options?: MakeOptions]

LoopRuntimeState

readonly loop: string & Brand<"LoopName">

readonly paused: boolean