Expand description
ResilientClient — an async-native HTTP transport.
One client per remote API. Concurrency is bounded by a semaphore; retry, auth refresh, a rate limit and a circuit breaker are inline middleware. Cancellation is structural: drop the future and the in-flight request goes with it.
The pieces live in one file each: builder assembles a client, attempt
runs one call’s attempt loop, breaker is the circuit breaker, rate the
token bucket, policy the retry knobs, and auth, error and observer
the types those exchange.
Structs§
- Call
Policy - The policy for one call.
- Client
Error - Resilient
Client - A cheap-to-clone resilient HTTP client. Build via
ResilientClient::builder. - Resilient
Client Builder - Builder for
ResilientClient. - Retry
Policy - Bounded retry: exponential from
base_backoff(doubling per attempt), capped atmax_backoff, with jitter added before each sleep.
Enums§
- Breaker
Mode - What an attempt does while the circuit breaker is open.
- Breaker
State - What a
ResilientClient’s breaker is doing right now, for consumers that poll instead of trackingTransportEvents. - Error
Kind - Retry
Mode - How many times, and how long apart, a failed attempt is repeated.
- Transport
Event
Traits§
Type Aliases§
- Auth
Future - Future returned by the auth token refresher.
- Auth
Refresher - Acquire (or re-acquire) an auth token — called lazily and on
401.