AdaptiveRetryStrategy

Implements a retry strategy with exponential backoff, a token bucket for limiting retries, and a client-side rate limiter for achieving the ideal request rate. Note that the backoff delayer, token bucket, and rate limiter all work independently of each other. Any of the three may delay retries (and the rate limiter may delay the initial try as well).

Note: The adaptive retry strategy is an advanced mode. It is not recommended for typical use cases. In most cases, StandardRetryStrategy is the preferred retry mode.

Parameters

config

The configuration for this retry strategy

Constructors

Link copied to clipboard
constructor(config: AdaptiveRetryStrategy.Config = Config.Default)

Types

Link copied to clipboard

Configuration parameters for an adaptive retry strategy

Properties

Link copied to clipboard

Inherited functions

Link copied to clipboard
open suspend override fun <R> retry(policy: RetryPolicy<R>, block: suspend () -> R): Outcome<R>

Retry the given block of code until it's successful. Note this method throws exceptions for non-successful outcomes from retrying.