RetryExecutor class
Handles retry logic for workflow steps based on RetryPolicy.
Calculates backoff delays and determines whether a step should be retried. Supports fixed-interval and exponential backoff with optional jitter.
Constructors
- RetryExecutor({Random? random})
- Creates a RetryExecutor.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
calculateDelay(
RetryPolicy policy, int attempt) → Duration - Calculates the delay before the next retry attempt.
-
executeWithRetry<
T> (RetryPolicy policy, Future< T> action(), {void onAttempt(int attempt)?, FutureOr<void> onRetry(int attempt, Object error)?, Future<void> delayFn(Duration delay)?}) → Future<T> -
Executes
actionwith retry logic according topolicy. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRetry(
RetryPolicy policy, int attempt) → bool -
Returns
trueif the step should be retried given the currentattempt. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited