RetryTokenBucket

A rate-limiting token bucket for use in a client-throttled retry strategy.

Inheritors

Types

Link copied to clipboard
interface Config

Configuration for a token bucket

Properties

Link copied to clipboard

Functions

Link copied to clipboard
abstract suspend fun acquireToken(): RetryToken

Acquire a token from the token bucket. This method should be called before the initial retry attempt for a block of code. This method may delay if there are already insufficient tokens in the bucket due to prior retry failures or large numbers of simultaneous requests.