RateLimitPartition.GetFixedWindowLimiter<TKey> 方法

定义

使用 给定 FixedWindowRateLimiterOptions的 定义分区FixedWindowRateLimiter

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

适用于