ErrorRecoveryStrategy class
Error recovery strategy.
Constructors
- ErrorRecoveryStrategy({required String name, required int maxRetries, required Duration initialDelay, required Duration maxDelay, required double backoffMultiplier})
- ErrorRecoveryStrategy.exponentialBackoff({int maxRetries = 5, Duration initialDelay = const Duration(milliseconds: 100), Duration maxDelay = const Duration(seconds: 30)})
-
Exponential backoff strategy (recommended).
factory
- ErrorRecoveryStrategy.immediate({int maxRetries = 3})
-
Immediate retry strategy.
factory
- ErrorRecoveryStrategy.linearBackoff({int maxRetries = 5, Duration delay = const Duration(seconds: 1)})
-
Linear backoff strategy.
factory
Properties
- backoffMultiplier → double
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialDelay → Duration
-
final
- maxDelay → Duration
-
final
- maxRetries → int
-
final
- name → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getDelayForAttempt(
int attemptNumber) → Duration - Get delay for a specific attempt.
-
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