Skip to content

@usine/orchestrator/schedule-triggers

A schedule loop whose agent is no longer in the loaded roster.

  • Schema.Class

new ScheduleAgentFailure(…args): ScheduleAgentFailure

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

ScheduleAgentFailure

readonly agent: string & Brand<"AgentName">

readonly loop: string & Brand<"LoopName">

readonly message: string


A schedule whose cron boundaries could not be computed at this instant. Cron.prev and Cron.next fail inside a DST spring-forward gap even for a cron that parsed; the schedule retries next cycle and its siblings run.

  • Schema.Class

new ScheduleCronFailure(…args): ScheduleCronFailure

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

ScheduleCronFailure

readonly cron: string

readonly loop: string & Brand<"LoopName">

readonly message: string

readonly tz: string


The result of evaluating every schedule loop at one instant.

  • Schema.Class

new ScheduleCycle(…args): ScheduleCycle

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

ScheduleCycle

readonly alreadyFired: number

readonly failures: readonly (ScheduleAgentFailure | ScheduleTickFailure | ScheduleCronFailure)[]

readonly fanout: number

readonly loops: number

readonly nextTickAt: Option<Utc>

readonly skipped: number

readonly submissions: readonly (Claimed | Queued | Ignored | CycleBlocked)[]


A selected repository whose Tick could not be evaluated or submitted.

  • Schema.Class

new ScheduleTickFailure(…args): ScheduleTickFailure

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

ScheduleTickFailure

readonly errorTag: string

readonly loop: string & Brand<"LoopName">

readonly message: string

readonly repository: string & Brand<"RepositoryName">

readonly scheduledAt: Utc


Turns due schedule ticks into one Event per selected repository.

  • Context.ServiceClass

readonly Service: object

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

readonly latest: Effect.Effect<Option.Option<ScheduleCycle>>

readonly run: (instance) => Effect.Effect<never>

Parameter Type
instance LoadedInstance

Effect.Effect<never>

readonly tick: (instance) => Effect.Effect<ScheduleCycle, EnginePersistenceError>

Evaluates the latest due Tick of every schedule. A repository’s failure is logged and reported without stopping its siblings; a cron failure in a DST gap fails only its own schedule.

Parameter Type
instance LoadedInstance

Effect.Effect<ScheduleCycle, EnginePersistenceError>

readonly static layer: Layer<ScheduleTriggers, never, ConfigParser | ExpressionEngine | RunEngine | LoopControl>

ScheduleFailure = typeof ScheduleFailure.Type

const ScheduleFailure: Schema.Union<readonly [typeof ScheduleAgentFailure, typeof ScheduleCronFailure, typeof ScheduleTickFailure]>