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