共用方式為


RateLimitPartition.GetFixedWindowLimiter<TKey> 方法

定義

使用 FixedWindowRateLimiter 指定的 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)

類型參數

TKey

要區分資料分割的型別。

參數

partitionKey
TKey

此分割區的特定索引鍵。

factory
Func<TKey,FixedWindowRateLimiterOptions>

需要指定 partitionKey 之速率限制器時所呼叫的函式。 這可以在不同的呼叫之間傳回相同的 實例 FixedWindowRateLimiterOptions

傳回

備註

設定 AutoReplenishmentfalse 以儲存配置。 這個方法會建立新的選項類型,並設定為 ,否則會設定 AutoReplenishmentfalse

適用於