Share via


TokenBucketRateLimiterOptions Class

Definition

Options to control the behavior of a TokenBucketRateLimiter.

public sealed class TokenBucketRateLimiterOptions
type TokenBucketRateLimiterOptions = class
Public NotInheritable Class TokenBucketRateLimiterOptions
Inheritance
TokenBucketRateLimiterOptions

Constructors

TokenBucketRateLimiterOptions()

Properties

AutoReplenishment

Specified whether the TokenBucketRateLimiter is automatically replenishing tokens or if someone else will be calling TryReplenish() to replenish tokens.

QueueLimit

Maximum cumulative token count of queued acquisition requests. Must be set to a value >= 0 by the time these options are passed to the constructor of TokenBucketRateLimiter.

QueueProcessingOrder

Determines the behaviour of AcquireAsync(Int32, CancellationToken) when not enough resources can be leased.

ReplenishmentPeriod

Specifies the minimum period between replenishments. Must be set to a value greater than Zero by the time these options are passed to the constructor of TokenBucketRateLimiter.

TokenLimit

Maximum number of tokens that can be in the bucket at any time. Must be set to a value > 0 by the time these options are passed to the constructor of TokenBucketRateLimiter.

TokensPerPeriod

Specifies the maximum number of tokens to restore each replenishment. Must be set to a value > 0 by the time these options are passed to the constructor of TokenBucketRateLimiter.

Applies to