System.Threading.RateLimiting.RateLimitPartition
Contains methods used in Create<T, U> to assist in the creation of partitions for your rate limiter.
public static RateLimitPartition<TKey> Get<TKey>(TKey partitionKey, Func<TKey, RateLimiter> factory)
Defines a partition with the given rate limiter factory.
public static RateLimitPartition<TKey> GetConcurrencyLimiter<TKey>(TKey partitionKey, Func<TKey, ConcurrencyLimiterOptions> factory)
Defines a partition with a ConcurrencyLimiter with the given ConcurrencyLimiterOptions.
public static RateLimitPartition<TKey> GetFixedWindowLimiter<TKey>(TKey partitionKey, Func<TKey, FixedWindowRateLimiterOptions> factory)
Defines a partition with a FixedWindowRateLimiter with the given FixedWindowRateLimiterOptions.
Defines a partition that will not have a rate limiter.
This means any calls to AttemptAcquire or AcquireAsync will always succeed for the given partitionKey.
public static RateLimitPartition<TKey> GetSlidingWindowLimiter<TKey>(TKey partitionKey, Func<TKey, SlidingWindowRateLimiterOptions> factory)
Defines a partition with a SlidingWindowRateLimiter with the given SlidingWindowRateLimiterOptions.
public static RateLimitPartition<TKey> GetTokenBucketLimiter<TKey>(TKey partitionKey, Func<TKey, TokenBucketRateLimiterOptions> factory)
Defines a partition with a TokenBucketRateLimiter with the given TokenBucketRateLimiterOptions.