RateLimiterConfigBuilder

class RateLimiterConfigBuilder(val baseConfig: RateLimiterConfig = defaultRateLimiterConfig) : ConfigBuilder<RateLimiterConfig> (source)

Builder for configuring a RateLimiterConfig instance. Use rateLimiterConfig to create one.

Constructors

Link copied to clipboard
constructor(baseConfig: RateLimiterConfig = defaultRateLimiterConfig)

Types

Link copied to clipboard
private object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open override val baseConfig: RateLimiterConfig

The base configuration object to be used as a starting point for building the final configuration object.

Link copied to clipboard

Configures the default duration a request will be placed in the queue if the request is rate-limited. After this duration, the request will be rejected. Should be non-negative.

Link copied to clipboard

Functions

Link copied to clipboard

Sets the rate limiting algorithm. See RateLimitingAlgorithm for more details.

Link copied to clipboard
open override fun build(): RateLimiterConfig

Builds the final configuration object after applying possible modifications to the base configuration.

Link copied to clipboard
Link copied to clipboard

Configures the exception handler that will be called when a request is rejected by the rate limiter. By default, the exception handler will the caught exception.