StepExecutionEngine

class StepExecutionEngine<C : ExecutionContext>(planBuilder: (C) -> List<Step<C>>, timeBufferMs: Long = 200)

Orchestrates the execution of a list of Steps based on a given plan.

Each step is executed in order. Execution stops on:

  • failure (Outcome.FAIL)

  • friction required (Outcome.FRICTION_REQUIRED)

  • time budget exceeded

Parameters

C

The context type shared across all steps.

planBuilder

A lambda that builds the list of steps to execute, based on the context.

timeBufferMs

Minimum buffer (ms) required before starting the next step.

Constructors

Link copied to clipboard
constructor(planBuilder: (C) -> List<Step<C>>, timeBufferMs: Long = 200)

Functions

Link copied to clipboard
suspend fun run(context: C): ExecutionDecision

Runs the execution plan for the given context.