StandardRetryStrategy

open class StandardRetryStrategy(val config: StandardRetryStrategy.Config = Config.default()) : RetryStrategy

Implements a retry strategy utilizing backoff delayer and a token bucket for rate limiting and circuit breaking. Note that the backoff delayer and token bucket work independently of each other. Either can delay retries (and the token bucket can delay the initial try). The delayer is called first so that the token bucket can refill as appropriate.

StandardRetryStrategy is the recommended retry mode for the majority of use cases.

Parameters

config

The options that control the functionality of this strategy.

Inheritors

Constructors

Link copied to clipboard
constructor(config: StandardRetryStrategy.Config = Config.default())

Types

Link copied to clipboard

Properties

Link copied to clipboard

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.