RateLimitPartition.GetFixedWindowLimiter<TKey> 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用 给定 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 同一实例。
返回
注解
设置为 AutoReplenishment 以 false
保存分配。 此方法将创建新的选项类型,否则设置为 AutoReplenishmentfalse
。