RetryBackOff class
Representation of the back-off method to use when retrying requests. A fixed
back-off will space retries out by interval. An exponential back-off will
delay retries by d*2^n
where d
is interval and n
is the number of
attempts so far.
Constructors
- RetryBackOff.exponential(Duration? interval, {bool withJitter = true, Duration? maxInterval})
-
Construct a new exponential back-off representation where interval is
the base duration from which each delay will be calculated.
const
- RetryBackOff.fixed(Duration? interval, {bool withJitter = true})
-
Construct a new fixed back-off representation where interval is the
delay between each retry.
const
- RetryBackOff.none()
-
Construct a null back-off representation, meaning no delay between retry
attempts.
const
Properties
- duration → Duration?
-
Use interval instead.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- interval → Duration?
-
The base duration from which the delay between retries will be calculated.
For fixed back-off, the delay will always be this value. For exponential
back-off, the delay will be this value multiplied by 2^n where
n
is the number of attempts so far.final - maxInterval → Duration?
-
The maximum duration between retries.
final
- method → RetryBackOffMethod
-
The back-off method to use. One of none, fixed, or exponential.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- withJitter → bool
-
Whether to enable jitter or not.
final
Methods
-
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
Constants
- defaultMaxInterval → const Duration
- The default maximum duration between retries. (5 minutes)