RateLimitPartition.GetFixedWindowLimiter<TKey> Metod

Definition

Definierar en partition med en FixedWindowRateLimiter med angiven FixedWindowRateLimiterOptions.

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

Typparametrar

TKey

Den typ som partitioner ska särskiljas med.

Parametrar

partitionKey
TKey

Den specifika nyckeln för den här partitionen.

factory
Func<TKey,FixedWindowRateLimiterOptions>

Funktionen anropas när en hastighetsbegränsning för angiven partitionKey krävs. Detta kan returnera samma instans av FixedWindowRateLimiterOptions mellan olika anrop.

Returer

Kommentarer

Ange AutoReplenishment till för att false spara en allokering. Den här metoden skapar en ny alternativtyp och anges AutoReplenishment till false annat.

Gäller för