ResilientHttpClient class final
Decorator around HttpClientContract that retries transient failures (HTTP 500/502/503/504 and SocketException) with exponential backoff.
Rate-limit handling (429) is intentionally left to RequestBucket.
- Implemented types
Constructors
- ResilientHttpClient(HttpClientContract _inner, {int maxRetries = 3, Duration initialBackoff = const Duration(milliseconds: 500), Duration maxBackoff = const Duration(seconds: 30)})
-
const
Properties
- config → HttpClientConfig
-
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialBackoff → Duration
-
final
- interceptor → HttpInterceptor
-
no setteroverride
- maxBackoff → Duration
-
final
- maxRetries → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → HttpClientStatus
-
no setteroverride
Methods
-
delete<
T> (RequestContract request) → Future< Response< T> > -
override
-
get<
T> (RequestContract request) → Future< Response< T> > -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch<
T> (RequestContract request) → Future< Response< T> > -
override
-
post<
T> (RequestContract request) → Future< Response< T> > -
override
-
put<
T> (RequestContract request) → Future< Response< T> > -
override
-
send<
T> (RequestContract request) → Future< Response< T> > -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited