RateLimitPartition.GetConcurrencyLimiter<TKey> Method

Definition

Defines a partition with a ConcurrencyLimiter with the given ConcurrencyLimiterOptions.

public static System.Threading.RateLimiting.RateLimitPartition<TKey> GetConcurrencyLimiter<TKey> (TKey partitionKey, Func<TKey,System.Threading.RateLimiting.ConcurrencyLimiterOptions> factory);
static member GetConcurrencyLimiter : 'Key * Func<'Key, System.Threading.RateLimiting.ConcurrencyLimiterOptions> -> System.Threading.RateLimiting.RateLimitPartition<'Key>
Public Shared Function GetConcurrencyLimiter(Of TKey) (partitionKey As TKey, factory As Func(Of TKey, ConcurrencyLimiterOptions)) As RateLimitPartition(Of TKey)

Type Parameters

TKey

The type to distinguish partitions with.

Parameters

partitionKey
TKey

The specific key for this partition. This will be used to check for an existing cached limiter before calling the factory.

factory
Func<TKey,ConcurrencyLimiterOptions>

The function called when a rate limiter for the given partitionKey is needed. This can return the same instance of ConcurrencyLimiterOptions across different calls.

Returns

Applies to