FallbackStrategy<T> class
final
Strategy that converts final pipeline failures into results.
Cancellation always bypasses fallback handling, even when fallbackIf is FallbackPredicate.any.
- Inheritance
-
- Object
- RetryPipelineStrategy<
T> - FallbackStrategy
Constructors
-
FallbackStrategy.callback(FutureOr<
T> callback(FallbackContext<T> context), {String? name, FallbackPredicate<T> ? fallbackIf, FutureOr<void> onFallback(FallbackContext<T> context)?}) -
Creates fallback with a
callback.factory -
FallbackStrategy.value(T value, {String? name, FallbackPredicate<
T> ? fallbackIf, FutureOr<void> onFallback(FallbackContext<T> context)?}) -
Creates fallback with a static
value.factory
Properties
-
fallback
→ FutureOr<
T> Function(FallbackContext<T> context) -
Computes fallback result.
final
-
fallbackIf
→ FallbackPredicate<
T> -
Decides whether fallback applies.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String?
-
Optional strategy instance name used in telemetry source.
finalinherited
-
onFallback
→ FutureOr<
void> Function(FallbackContext<T> context)? -
Called before fallback produces a result.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
execute(
RetryPipelineContext< T> context, Future<T> next()) → Future<T> -
Executes this strategy around
next.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