Condividi tramite


RateLimitPartition.GetFixedWindowLimiter<TKey> Metodo

Definizione

Definisce una partizione con un FixedWindowRateLimiter oggetto con l'oggetto specificato FixedWindowRateLimiterOptions.

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)

Parametri di tipo

TKey

Tipo con cui distinguere le partizioni.

Parametri

partitionKey
TKey

Chiave specifica per questa partizione.

factory
Func<TKey,FixedWindowRateLimiterOptions>

Funzione chiamata quando è necessario un limite di velocità per l'oggetto specificato partitionKey . Ciò può restituire la stessa istanza di FixedWindowRateLimiterOptions tra chiamate diverse.

Restituisce

Commenti

Impostare AutoReplenishment su false per salvare un'allocazione. Questo metodo creerà un nuovo tipo di opzioni e impostato su AutoReplenishmentfalse in caso contrario.

Si applica a