1 write to _options
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (1)
67
_options
= new FixedWindowRateLimiterOptions
28 references to _options
System.Threading.RateLimiting (28)
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (28)
39
public override bool IsAutoReplenishing =>
_options
.AutoReplenishment;
42
public override TimeSpan ReplenishmentPeriod =>
_options
.Window;
80
if (
_options
.AutoReplenishment)
82
_renewTimer = new Timer(Replenish, this,
_options
.Window,
_options
.Window);
104
if (permitCount >
_options
.PermitLimit)
106
throw new ArgumentOutOfRangeException(nameof(permitCount), permitCount, SR.Format(SR.PermitLimitExceeded, permitCount,
_options
.PermitLimit));
140
if (permitCount >
_options
.PermitLimit)
142
throw new ArgumentOutOfRangeException(nameof(permitCount), permitCount, SR.Format(SR.PermitLimitExceeded, permitCount,
_options
.PermitLimit));
163
Debug.Assert(
_options
.QueueLimit >= _queueCount);
164
if (
_options
.QueueLimit - _queueCount < permitCount)
166
if (
_options
.QueueProcessingOrder == QueueProcessingOrder.NewestFirst && permitCount <=
_options
.QueueLimit)
194
while (
_options
.QueueLimit - _queueCount < permitCount);
207
Debug.Assert(_queueCount <=
_options
.QueueLimit);
217
int replenishWindow = Math.Max(replenishAmount /
_options
.PermitLimit, 1);
219
return new FixedWindowLease(false, TimeSpan.FromTicks(
_options
.Window.Ticks * replenishWindow));
239
if (_queueCount == 0 || (_queueCount > 0 &&
_options
.QueueProcessingOrder == QueueProcessingOrder.NewestFirst))
263
if (
_options
.AutoReplenishment)
294
if (((nowTicks - _lastReplenishmentTick) * TickFrequency) <
_options
.Window.Ticks && !
_options
.AutoReplenishment)
303
if (availablePermitCounters >=
_options
.PermitLimit)
309
_permitCount =
_options
.PermitLimit;
315
_options
.QueueProcessingOrder == QueueProcessingOrder.OldestFirst
324
_options
.QueueProcessingOrder == QueueProcessingOrder.OldestFirst
333
_options
.QueueProcessingOrder == QueueProcessingOrder.OldestFirst
371
if (_permitCount ==
_options
.PermitLimit)
398
RequestRegistration next =
_options
.QueueProcessingOrder == QueueProcessingOrder.OldestFirst