ResilientClient class
A primary entry point for developers to execute resilient operations.
Constructors
- ResilientClient({int retries = 3, RetryStrategy strategy = RetryStrategy.fixed, Duration retryDelay = const Duration(seconds: 1), Duration? maxRetryDelay, CircuitBreaker? circuitBreaker, Duration timeout = const Duration(seconds: 10), bool retryIf(Object)?})
- ResilientClient.fromPolicy(ResiliencePolicy policy)
- Creates a ResilientClient from an existing ResiliencePolicy.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- policy → ResiliencePolicy
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
execute<
T> (Future< T> action(), {FutureOr<T> fallback()?}) → Future<T> -
Executes the
actionwith the configured resilience policies. Iffallbackis provided, it will be executed if all retries fail or the circuit is open. -
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