CustomBackoff class
Implements a custom backoff strategy defined by a function. Useful for testing or complex retry logic.
- Implemented types
Constructors
-
CustomBackoff(FutureOr<
Duration> delayCalculator(int attemptNumber)) -
Creates a custom backoff strategy.
const
Properties
-
delayCalculator
→ FutureOr<
Duration> Function(int attemptNumber) -
A function that takes the attempt number and returns the delay duration.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getDelay(
int attemptNumber) → FutureOr< Duration> -
Calculates the delay for a given retry attempt.
Can return a Duration directly or a Future<Duration>.
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