RetryInterceptor class
- Inheritance
-
- Object
- FittorInterceptor
- RetryInterceptor
Constructors
-
RetryInterceptor.new({int maxRetries = 3, Duration baseDelay = const Duration(milliseconds: 1000), Duration maxDelay = const Duration(seconds: 30), double backoffMultiplier = 2.0, bool retryOnTimeout = true, bool retryOnConnectionError = true, List<
int> retryStatusCodes = const [408, 429, 500, 502, 503, 504]})
Properties
- backoffMultiplier → double
-
final
- baseDelay → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxDelay → Duration
-
final
- maxRetries → int
-
final
- retryOnConnectionError → bool
-
final
- retryOnTimeout → bool
-
final
-
retryStatusCodes
→ List<
int> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
calculateDelay(
int attempt) → Duration -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onError(
dynamic error, StackTrace stackTrace) → Future -
Called when an error occurs during request processing
override
-
onRequest(
FittorRequest request) → Future< FittorRequest> -
Called before a request is sent
inherited
-
onResponse(
FittorResponse response) → Future< FittorResponse> -
Called after a successful response is received
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited