2 instantiations of RateLimitPartition
Microsoft.AspNetCore.RateLimiting (1)
RateLimiterOptions.cs (1)
115
return new
RateLimitPartition
<DefaultKeyType>(partitionKey, static key => ((Func<TPartitionKey, RateLimiter>)key.Factory!)((TPartitionKey)key.Key!));
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\RateLimitPartition.cs (1)
25
return new
RateLimitPartition
<TKey>(partitionKey, factory);
22 references to RateLimitPartition
Microsoft.AspNetCore.RateLimiting (9)
DefaultRateLimiterPolicy.cs (3)
11
private readonly Func<HttpContext,
RateLimitPartition
<DefaultKeyType>> _partitioner;
14
public DefaultRateLimiterPolicy(Func<HttpContext,
RateLimitPartition
<DefaultKeyType>> partitioner, Func<OnRejectedContext, CancellationToken, ValueTask>? onRejected)
22
public
RateLimitPartition
<DefaultKeyType> GetPartition(HttpContext httpContext)
IRateLimiterPolicy.cs (2)
20
/// Gets the <see cref="
RateLimitPartition
{TPartitionKey}"/> that applies to the given <see cref="HttpContext"/>.
23
RateLimitPartition
<TPartitionKey> GetPartition(HttpContext httpContext);
RateLimiterOptions.cs (4)
48
public RateLimiterOptions AddPolicy<TPartitionKey>(string policyName, Func<HttpContext,
RateLimitPartition
<TPartitionKey>> partitioner)
109
internal static Func<HttpContext,
RateLimitPartition
<DefaultKeyType>> ConvertPartitioner<TPartitionKey>(string? policyName, Func<HttpContext,
RateLimitPartition
<TPartitionKey>> partitioner)
113
RateLimitPartition
<TPartitionKey> partition = partitioner(context);
System.Threading.RateLimiting (13)
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (4)
15
private readonly Func<TResource,
RateLimitPartition
<TKey>> _partitioner;
35
public DefaultPartitionedRateLimiter(Func<TResource,
RateLimitPartition
<TKey>> partitioner,
42
private DefaultPartitionedRateLimiter(Func<TResource,
RateLimitPartition
<TKey>> partitioner,
89
RateLimitPartition
<TKey> partition = _partitioner(resource);
System\Threading\RateLimiting\PartitionedRateLimiter.cs (2)
23
/// If the <see cref="
RateLimitPartition
{TKey}.PartitionKey"/> matches a cached entry then the rate limiter previously used for that key is used. Otherwise, the factory is called to get a new rate limiter.</param>
27
Func<TResource,
RateLimitPartition
<TPartitionKey>> partitioner,
System\Threading\RateLimiting\RateLimitPartition.cs (6)
21
public static
RateLimitPartition
<TKey> Get<TKey>(
35
public static
RateLimitPartition
<TKey> GetConcurrencyLimiter<TKey>(
49
public static
RateLimitPartition
<TKey> GetNoLimiter<TKey>(TKey partitionKey)
64
public static
RateLimitPartition
<TKey> GetTokenBucketLimiter<TKey>(
98
public static
RateLimitPartition
<TKey> GetSlidingWindowLimiter<TKey>(
132
public static
RateLimitPartition
<TKey> GetFixedWindowLimiter<TKey>(
System\Threading\RateLimiting\RateLimitPartition.T.cs (1)
13
/// Constructs the <see cref="
RateLimitPartition
{TKey}"/> for use in <see cref="PartitionedRateLimiter.Create"/>.