Durable.Executor.CompensationRunner (Durable v0.1.0-rc)
View SourceExecutes compensation handlers for saga pattern rollbacks.
Compensations are executed in reverse order when a workflow step fails and need to undo the effects of previously completed steps.
Behavior
- Compensations run in reverse order (last completed step first)
- Each compensation is recorded as a step_execution with
is_compensation: true - Compensation failures are logged but don't stop the compensation chain
- Retry logic is supported for individual compensations
Summary
Functions
Executes a single compensation handler with retry logic.
Types
Functions
@spec execute( Durable.Definition.Compensation.t(), String.t(), atom(), Durable.Config.t() ) :: result()
Executes a single compensation handler with retry logic.
Returns {:ok, output} on success or {:error, reason} after all retries exhausted.
Compensation errors don't stop the chain - they are recorded and the process continues.