Package-level declarations

Types

Link copied to clipboard

A client-side rate limiter backed by a token bucket. This limiter adaptively updates the refill rate of the bucket based on the number of successful transactions vs throttling errors. This limiter applies a smoothing function in an attempt to converge on the ideal transaction rate feasible for downstream systems.

Link copied to clipboard
interface DelayProvider

An object that can be used to delay between iterations of code.

Link copied to clipboard

A DelayProvider that implements exponential backoff with jitter (i.e., randomization of delay amount). When RetryContext.errorType is non-null, the delay provider uses it to select the base delay. When RetryContext.retryAfter is non-null, it is used to clamp the computed delay. When either field is null, the provider falls back to Config.initialDelay as the base and pure exponential backoff respectively.

Link copied to clipboard

A RetryTokenBucket that doesn't actually track tokens, effectively simulating "infinite" token capacity. All operations immediately succeed and no blocking occurs.

Link copied to clipboard
interface RateLimiter

A client-side utility that can limit the rate of transactions. This limiter is usually backed by some set of permits which refill over time. This kind of rate limiting is often used in conjunction with a retry algorithm, especially when it may be desirable to delay the initial attempt of a transaction (instead of just delaying subsequent attempts).

Link copied to clipboard

Indicates that the token bucket has exhausted its capacity and was configured to throw exceptions (vs delay).

Link copied to clipboard
interface RetryToken

A token from a RetryTokenBucket. This token grants the holder the right to attempt a try/retry of a block of code. The token is effectively "borrowed" from the token bucket and must be returned when the retry attempt is completed, either by calling notifySuccess or scheduleRetry.

Link copied to clipboard

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

Link copied to clipboard

The standard implementation of a RetryTokenBucket.