@usine/engine/step-executor
Classes
Section titled “Classes”StepExecution
Section titled “StepExecution”The saved Event, effective task and Agent, and Step being tried in one Attempt.
Extends
Section titled “Extends”Schema.Class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new StepExecution(…
args):StepExecution
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…args |
[props: object, options?: MakeOptions] |
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlyagent:Agent
attempt
Section titled “attempt”
readonlyattempt:Attempt
readonlyevent:Event
parentModel
Section titled “parentModel”
readonlyparentModel:Option<string&Brand<"ModelId">>
reattach
Section titled “reattach”
readonlyreattach:boolean
The Attempt was open when the orchestrator stopped and its parent task is still live: execution reattaches to it instead of starting it.
repository
Section titled “repository”
readonlyrepository:string&Brand<"RepositoryName">
resume
Section titled “resume”
readonlyresume:Option<SalvagePushed>
The newest pushed salvage of an earlier Attempt of this Run, which this Attempt’s checkout resumes from.
revision
Section titled “revision”
readonlyrevision:string&Brand<"RepositoryRevision">
readonlyrun:Run
readonlystep:Step
readonlytask:string&Brand<"AttemptTask">
StepExecutor
Section titled “StepExecutor”Runs one Attempt on a Worker: reserve capacity, execute the step, interrupt on cancel.
Extends
Section titled “Extends”Context.ServiceClass
Properties
Section titled “Properties”Service
Section titled “Service”
readonlyService:object
The service’s operations: what yield* StepExecutor returns.
execute
Section titled “execute”
readonlyexecute: (execution,io) =>Effect.Effect<StepResult,AttemptFailure>
Runs the reserved Attempt, or reattaches to it when execution.reattach is set, recording channel activity through io, and waits for its result.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
execution |
StepExecution |
io |
Sink |
Returns
Section titled “Returns”Effect.Effect<StepResult, AttemptFailure>
interrupt
Section titled “interrupt”
readonlyinterrupt: (attemptId) =>Effect.Effect<void,AttemptFailure>
Requests that the identified Attempt stop its current work.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
attemptId |
AttemptId |
Returns
Section titled “Returns”Effect.Effect<void, AttemptFailure>
intervene
Section titled “intervene”
readonlyintervene: (attemptId,intervention) =>Effect.Effect<void,AttemptFailure>
Sends a nonterminal operator action to a live session in the identified Attempt.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
attemptId |
AttemptId |
intervention |
Intervention |
Returns
Section titled “Returns”Effect.Effect<void, AttemptFailure>
isLive
Section titled “isLive”
readonlyisLive: (attemptId) =>Effect.Effect<boolean,AttemptFailure>
Whether the Attempt’s parent task outlived an orchestrator restart, so its Run reattaches it instead of opening the next Attempt: the task still runs, or it finished and its result still has to be collected from the Worker.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
attemptId |
AttemptId |
Returns
Section titled “Returns”Effect.Effect<boolean, AttemptFailure>
outcome
Section titled “outcome”
readonlyoutcome: (attemptId) =>Effect.Effect<Option.Option<Result.Result<StepResult,AttemptFailure>>,AttemptFailure>
The result an open Attempt’s parent task stored before an orchestrator restart, which its Run never recorded. The Run finishes the Attempt with it instead of failing it as interrupted; none when nothing was stored.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
attemptId |
AttemptId |
Returns
Section titled “Returns”Effect.Effect<Option.Option<Result.Result<StepResult, AttemptFailure>>, AttemptFailure>
recover
Section titled “recover”
readonlyrecover: <E>(attempt,record) =>Effect.Effect<void,E|AttemptFailure>
Reconciles an old checkout before new Attempts start; records its salvage before releasing any work.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
E |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
attempt |
AttemptRecovery |
record |
(salvage) => Effect.Effect<void, E> |
Returns
Section titled “Returns”Effect.Effect<void, E | AttemptFailure>
reserve
Section titled “reserve”
readonlyreserve: (submission) =>Effect.Effect<WorkerLease,AttemptFailure>
Waits for Worker capacity; the returned lease must be released after execution or cancellation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
submission |
Submission |
Returns
Section titled “Returns”Effect.Effect<WorkerLease, AttemptFailure>
Interfaces
Section titled “Interfaces”WorkerLease
Section titled “WorkerLease”A reservation of one Worker’s capacity for the length of an Attempt. Call release when the Attempt ends.
Properties
Section titled “Properties”release
Section titled “release”
readonlyrelease:Effect<void>
worker
Section titled “worker”
readonlyworker:string&Brand<"WorkerName">