1 write to _options
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (1)
66
_options
= new FixedWindowRateLimiterOptions
28 references to _options
System.Threading.RateLimiting (28)
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (28)
38
public override bool IsAutoReplenishing =>
_options
.AutoReplenishment;
41
public override TimeSpan ReplenishmentPeriod =>
_options
.Window;
79
if (
_options
.AutoReplenishment)
81
_renewTimer = new Timer(Replenish, this,
_options
.Window,
_options
.Window);
103
if (permitCount >
_options
.PermitLimit)
105
throw new ArgumentOutOfRangeException(nameof(permitCount), permitCount, SR.Format(SR.PermitLimitExceeded, permitCount,
_options
.PermitLimit));
139
if (permitCount >
_options
.PermitLimit)
141
throw new ArgumentOutOfRangeException(nameof(permitCount), permitCount, SR.Format(SR.PermitLimitExceeded, permitCount,
_options
.PermitLimit));
162
Debug.Assert(
_options
.QueueLimit >= _queueCount);
163
if (
_options
.QueueLimit - _queueCount < permitCount)
165
if (
_options
.QueueProcessingOrder == QueueProcessingOrder.NewestFirst && permitCount <=
_options
.QueueLimit)
193
while (
_options
.QueueLimit - _queueCount < permitCount);
206
Debug.Assert(_queueCount <=
_options
.QueueLimit);
216
int replenishWindow = Math.Max(replenishAmount /
_options
.PermitLimit, 1);
218
return new FixedWindowLease(false, TimeSpan.FromTicks(
_options
.Window.Ticks * replenishWindow));
238
if (_queueCount == 0 || (_queueCount > 0 &&
_options
.QueueProcessingOrder == QueueProcessingOrder.NewestFirst))
262
if (
_options
.AutoReplenishment)
293
if (RateLimiterHelper.GetElapsedTime(_lastReplenishmentTick, nowTicks) <
_options
.Window && !
_options
.AutoReplenishment)
302
if (availablePermitCounters >=
_options
.PermitLimit)
308
_permitCount =
_options
.PermitLimit;
314
_options
.QueueProcessingOrder == QueueProcessingOrder.OldestFirst
323
_options
.QueueProcessingOrder == QueueProcessingOrder.OldestFirst
332
_options
.QueueProcessingOrder == QueueProcessingOrder.OldestFirst
370
if (_permitCount ==
_options
.PermitLimit)
397
RequestRegistration next =
_options
.QueueProcessingOrder == QueueProcessingOrder.OldestFirst