RateLimiterPluginConfigBuilder

Builder for configuring the KresilRateLimiterPlugin.

Constructors

Link copied to clipboard
constructor(baseConfig: RateLimiterPluginConfig)

Properties

Link copied to clipboard
Link copied to clipboard
var baseTimeoutDuration: <Error class: unknown class>

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
private var callWeight: CallWeight
Link copied to clipboard
Link copied to clipboard
private var interceptPhase: <Error class: unknown class><suspend (<Error class: unknown class>) -> Unit>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val rateLimiterConfig: <Error class: unknown class>
Link copied to clipboard
private val rateLimiterConfigBuilder: <Error class: unknown class>

Functions

Link copied to clipboard
fun algorithm(algorithm: <Error class: unknown class>)

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

Link copied to clipboard
Link copied to clipboard
fun callWeight(callWeight: CallWeight)

Sets the weight of a call for rate limiting purposes. The weight is used to determine how many permits a call consumes.

Link copied to clipboard

Sets the function to determine if a request should be excluded from rate limiting.

Link copied to clipboard
fun interceptPhase(interceptPhase: <Error class: unknown class><suspend (<Error class: unknown class>) -> Unit>)

Sets the phase in the application pipeline where rate limiting is applied.

Link copied to clipboard
fun keyResolver(keyResolver: KeyResolver)

Sets the function to resolve the key for rate limiting from the application call.

Link copied to clipboard
fun onRejectedCall(onRejectedCall: OnRejectedCall)

Sets the callback to handle requests that are rejected due to rate limiting.

Link copied to clipboard
fun onSuccessCall(onSuccessCall: OnSuccessCall)

Sets the callback to handle successful requests.