Dela via


RateLimitPartition Class

Definition

Contains methods used in Create<TResource,TPartitionKey>(Func<TResource,RateLimitPartition<TPartitionKey>>, IEqualityComparer<TPartitionKey>) to assist in the creation of partitions for your rate limiter.

public static class RateLimitPartition
type RateLimitPartition = class
Public Class RateLimitPartition
Inheritance
RateLimitPartition

Methods

Get<TKey>(TKey, Func<TKey,RateLimiter>)

Defines a partition with the given rate limiter factory.

GetConcurrencyLimiter<TKey>(TKey, Func<TKey,ConcurrencyLimiterOptions>)

Defines a partition with a ConcurrencyLimiter with the given ConcurrencyLimiterOptions.

GetFixedWindowLimiter<TKey>(TKey, Func<TKey,FixedWindowRateLimiterOptions>)

Defines a partition with a FixedWindowRateLimiter with the given FixedWindowRateLimiterOptions.

GetNoLimiter<TKey>(TKey)

Defines a partition that will not have a rate limiter. This means any calls to AttemptAcquire(TResource, Int32) or AcquireAsync(TResource, Int32, CancellationToken) will always succeed for the given partitionKey.

GetSlidingWindowLimiter<TKey>(TKey, Func<TKey,SlidingWindowRateLimiterOptions>)

Defines a partition with a SlidingWindowRateLimiter with the given SlidingWindowRateLimiterOptions.

GetTokenBucketLimiter<TKey>(TKey, Func<TKey,TokenBucketRateLimiterOptions>)

Defines a partition with a TokenBucketRateLimiter with the given TokenBucketRateLimiterOptions.

Applies to