HostedCompensation<T> class
final
A named, result-aware compensation registered when a host is constructed.
Registrations must be supplied again after restart. Completed-step inputs are encoded snapshots, not serialized closures or mutable captures.
- Implemented types
Constructors
-
HostedCompensation({required String name, required FutureOr<
void> run(WorkflowCompensationContext context, T value), Codec<T, Object?> ? codec, WorkflowRetryPolicy retryPolicy = const WorkflowRetryPolicy()}) -
Creates a typed cleanup handler and its independent retry policy.
const
Properties
-
codec
→ Codec<
T, Object?> ? -
Decodes the successful result snapshot supplied to run.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Stable handler ID persisted with successful checkpoints.
final
- retryPolicy → WorkflowRetryPolicy
-
Independent cleanup attempt budget; first attempt is included.
final
-
run
→ FutureOr<
void> Function(WorkflowCompensationContext context, T value) -
Cleanup operation invoked with the completed step's decoded value.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bind(
PayloadCodecRegistry codecs) → WorkflowCompensationHandler -
Reconstructs executable cleanup using a host codec snapshot.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited