5 types derived from RateLimiter
Microsoft.AspNetCore.RateLimiting.Tests (1)
TestRateLimiter.cs (1)
8
internal class TestRateLimiter :
RateLimiter
System.Threading.RateLimiting (4)
System\Threading\RateLimiting\ChainedRateLimiter.cs (1)
14
internal sealed partial class ChainedRateLimiter :
RateLimiter
System\Threading\RateLimiting\ConcurrencyLimiter.cs (1)
14
public sealed class ConcurrencyLimiter :
RateLimiter
System\Threading\RateLimiting\NoopLimiter.cs (1)
9
internal sealed class NoopLimiter :
RateLimiter
System\Threading\RateLimiting\ReplenishingRateLimiter.cs (1)
9
public abstract class ReplenishingRateLimiter :
RateLimiter
56 references to RateLimiter
Microsoft.AspNetCore.RateLimiting (2)
RateLimiterOptions.cs (2)
46
/// <param name="policyName">The name to be associated with the given <see cref="
RateLimiter
"/>.</param>
115
return new RateLimitPartition<DefaultKeyType>(partitionKey, static key => ((Func<TPartitionKey,
RateLimiter
>)key.Factory!)((TPartitionKey)key.Key!));
Microsoft.AspNetCore.RateLimiting.Tests (6)
TestPartitionedRateLimiter.cs (6)
15
private readonly List<
RateLimiter
> _limiters = new List<
RateLimiter
>();
19
public TestPartitionedRateLimiter(
RateLimiter
limiter)
24
public void AddLimiter(
RateLimiter
limiter)
41
foreach (
var
limiter in _limiters)
67
foreach (
var
limiter in _limiters)
System.Threading.RateLimiting (48)
System\Threading\RateLimiting\ChainedRateLimiter.cs (5)
16
private readonly
RateLimiter
[] _limiters;
19
public ChainedRateLimiter(
RateLimiter
[] limiters)
21
_limiters = (
RateLimiter
[])limiters.Clone();
33
foreach (
RateLimiter
limiter in _limiters)
65
foreach (
RateLimiter
limiter in _limiters)
System\Threading\RateLimiting\ConcurrencyLimiter.cs (1)
12
/// <see cref="
RateLimiter
"/> implementation that helps manage concurrent access to a resource.
System\Threading\RateLimiting\ConcurrencyLimiterOptions.cs (1)
18
/// Determines the behaviour of <see cref="
RateLimiter
.AcquireAsync"/> when not enough resources can be leased.
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (11)
19
private readonly Dictionary<TKey, Lazy<
RateLimiter
>> _limiters;
26
private readonly List<KeyValuePair<TKey, Lazy<
RateLimiter
>>> _cachedLimiters = new();
28
private readonly List<
RateLimiter
> _limitersToDispose = new();
45
_limiters = new Dictionary<TKey, Lazy<
RateLimiter
>>(equalityComparer);
87
private
RateLimiter
GetRateLimiter(TResource resource)
90
Lazy<
RateLimiter
>? limiter;
97
limiter = new Lazy<
RateLimiter
>(() => partition.Factory(partition.PartitionKey));
128
foreach (KeyValuePair<TKey, Lazy<
RateLimiter
>> limiter in _limiters)
163
foreach (KeyValuePair<TKey, Lazy<
RateLimiter
>> limiter in _limiters)
228
foreach (KeyValuePair<TKey, Lazy<
RateLimiter
>> rateLimiter in _cachedLimiters)
268
foreach (
RateLimiter
limiter in _limitersToDispose)
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (1)
12
/// <see cref="
RateLimiter
"/> implementation that refreshes allowed permits in a window periodically.
System\Threading\RateLimiting\FixedWindowRateLimiterOptions.cs (1)
33
/// Determines the behaviour of <see cref="
RateLimiter
.AcquireAsync"/> when not enough resources can be leased.
System\Threading\RateLimiting\QueueProcessingOrder.cs (3)
7
/// Controls the behavior of <see cref="
RateLimiter
.AcquireAsync"/> when not enough resources can be leased.
12
/// Lease the oldest queued <see cref="
RateLimiter
.AcquireAsync"/> call.
16
/// Lease the newest queued <see cref="
RateLimiter
.AcquireAsync"/> call.
System\Threading\RateLimiting\RateLimiter.cs (13)
14
/// Creates a single <see cref="
RateLimiter
"/> that wraps the passed in <see cref="
RateLimiter
"/>s.
18
/// Methods on the returned <see cref="
RateLimiter
"/> will iterate over the passed in <paramref name="limiters"/> in the order given.
21
/// <see cref="
RateLimiter
.GetStatistics()"/> will return the lowest value for <see cref="RateLimiterStatistics.CurrentAvailablePermits"/>,
29
/// <param name="limiters">The <see cref="
RateLimiter
"/>s that will be called in order when acquiring resources.</param>
33
public static
RateLimiter
CreateChained(params
RateLimiter
[] limiters)
49
/// Gets a snapshot of the <see cref="
RateLimiter
"/> statistics if available.
51
/// <returns>An instance of <see cref="RateLimiterStatistics"/> containing a snapshot of the <see cref="
RateLimiter
"/> statistics.</returns>
55
/// Specifies how long the <see cref="
RateLimiter
"/> has had all permits available. Used by RateLimiter managers that may want to
59
/// Returns <see langword="null"/> when the <see cref="
RateLimiter
"/> is in use or is not ready to be idle.
83
/// Method that <see cref="
RateLimiter
"/> implementations implement for <see cref="AttemptAcquire"/>.
115
/// Method that <see cref="
RateLimiter
"/> implementations implement for <see cref="AcquireAsync"/>.
System\Threading\RateLimiting\RateLimiterStatistics.cs (3)
7
/// Snapshot of statistics for a <see cref="
RateLimiter
"/>.
17
/// Gets the number of permits currently available for the <see cref="
RateLimiter
"/>.
22
/// Gets the number of queued permits for the <see cref="
RateLimiter
"/>.
System\Threading\RateLimiting\RateLimitLease.cs (1)
10
/// Abstraction for leases returned by <see cref="
RateLimiter
"/> implementations.
System\Threading\RateLimiting\RateLimitPartition.cs (1)
23
Func<TKey,
RateLimiter
> factory)
System\Threading\RateLimiting\RateLimitPartition.T.cs (2)
17
public RateLimitPartition(TKey partitionKey, Func<TKey,
RateLimiter
> factory)
31
public Func<TKey,
RateLimiter
> Factory { get; }
System\Threading\RateLimiting\ReplenishingRateLimiter.cs (1)
7
/// Abstraction that specifies that the <see cref="
RateLimiter
"/> implementation is capable of replenishing tokens.
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (1)
12
/// <see cref="
RateLimiter
"/> implementation that replenishes permit counters periodically instead of via a release mechanism.
System\Threading\RateLimiting\SlidingWindowRateLimiterOptions.cs (1)
39
/// Determines the behaviour of <see cref="
RateLimiter
.AcquireAsync"/> when not enough resources can be leased.
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (1)
12
/// <see cref="
RateLimiter
"/> implementation that replenishes tokens periodically instead of via a release mechanism.
System\Threading\RateLimiting\TokenBucketRateLimiterOptions.cs (1)
39
/// Determines the behaviour of <see cref="
RateLimiter
.AcquireAsync"/> when not enough resources can be leased.