Interface Outcome<T>

Type Parameters:
T - the run's terminal output type
All Known Implementing Classes:
Outcome.Aborted, Outcome.Completed, Outcome.Failed, Outcome.Suspended

public sealed interface Outcome<T> permits Outcome.Completed<T>, Outcome.Failed<T>, Outcome.Aborted<T>, Outcome.Suspended<T>
Terminal result of a ResumableRun.execute(I, com.tnsai.reliability.RunConfig) or ResumableRun.resume(java.lang.String) call (TNS-299). Sealed so consumers can pattern-match exhaustively on the four discrete shapes a run lifecycle can resolve to: Outcome.Completed, Outcome.Failed, Outcome.Aborted, Outcome.Suspended.

Outcome.Suspended is the unusual one. It's returned when the run is cleanly paused (manual breakpoint, deliberate yield) rather than aborted — the consumer can resume it later via the run's id, and the subsequent ResumableRun.resume(java.lang.String) call picks up from the saved checkpoint.

Since:
0.10.0 (TNS-299)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Orchestrator policy stopped the run; cause is the AbortReason.
    static final record 
    Run finished its step list.
    static final record 
    A step threw and the orchestrator exhausted retries.
    static final record 
    Run yielded cleanly at a step boundary.
  • Method Summary

    Modifier and Type
    Method
    Description
    Correlation id shared with Checkpoint.runId.
  • Method Details

    • runId

      String runId()
      Correlation id shared with Checkpoint.runId.