StandardRetryTokenBucket

The standard implementation of a RetryTokenBucket.

Parameters

config

The configuration to use for this bucket.

timeSource

A monotonic time source to use for calculating the temporal token fill of the bucket.

Constructors

Link copied to clipboard
constructor(options: StandardRetryTokenBucket.Config = Config.Default)

Initializes a new StandardRetryTokenBucket.

Types

Link copied to clipboard

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override 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.