Skip to main content

ExecutorHandler

Trait ExecutorHandler 

Source
pub trait ExecutorHandler: Send + Sync {
    // Required method
    fn execute(&self, ctx: ExecutorContext) -> HandlerOutput;
}
Expand description

Trait for executor implementations to fulfill for attempt execution.

The handler is invoked for each attempt with full context including RunId and AttemptId for traceability. Implementations must return a typed HandlerOutput that indicates whether the attempt succeeded, should be retried, or should be marked as a terminal failure.

§Invariants

  • Handlers must not mutate attempt-counting or run-derivation accounting.
  • Handlers must use the RunId and AttemptId from HandlerInput for all logging and reporting.
  • Long-running work must cooperate with timeout enforcement by polling CancellationToken::is_cancelled() at a bounded cadence.

Required Methods§

Source

fn execute(&self, ctx: ExecutorContext) -> HandlerOutput

Executes the attempt with the provided context and returns the outcome.

§Arguments
  • ctx - The full execution context, including run/attempt identifiers, payload, metadata, and optional workflow extensions.
§Returns

A HandlerOutput that indicates the attempt outcome:

Implementors§