Skip to main content

CompensationHandler

Type Alias CompensationHandler 

Source
pub type CompensationHandler = Arc<dyn Fn(&Value) -> Result<Value, String> + Send + Sync>;
Expand description

A registered rollback handler for a CompensatableEffect kind.

The handler receives the journaled output of the effect occurrence to undo and returns a compensation record (what was done to undo it) for journaling. Errors are plain strings because compensation failures cross the retry taxonomy’s string-classified boundary — a failed compensation is an operator signal, classified and surfaced, never silently retried by the kernel (automatic compensation stays out of scope, as in R0.6).

Arc-wrapped so an admission can hand the caller a cheap clone of the registered undo path.

Aliased Type§

pub struct CompensationHandler { /* private fields */ }