1 write to _options
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (1)
73_options = new TokenBucketRateLimiterOptions
30 references to _options
System.Threading.RateLimiting (30)
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (30)
41public override bool IsAutoReplenishing => _options.AutoReplenishment; 44public override TimeSpan ReplenishmentPeriod => _options.ReplenishmentPeriod; 88if (_options.AutoReplenishment) 90_renewTimer = new Timer(Replenish, this, _options.ReplenishmentPeriod, _options.ReplenishmentPeriod); 111if (tokenCount > _options.TokenLimit) 113throw new ArgumentOutOfRangeException(nameof(tokenCount), tokenCount, SR.Format(SR.TokenLimitExceeded, tokenCount, _options.TokenLimit)); 145if (tokenCount > _options.TokenLimit) 147throw new ArgumentOutOfRangeException(nameof(tokenCount), tokenCount, SR.Format(SR.TokenLimitExceeded, tokenCount, _options.TokenLimit)); 168Debug.Assert(_options.QueueLimit >= _queueCount); 169if (_options.QueueLimit - _queueCount < tokenCount) 171if (_options.QueueProcessingOrder == QueueProcessingOrder.NewestFirst && tokenCount <= _options.QueueLimit) 199while (_options.QueueLimit - _queueCount < tokenCount); 212Debug.Assert(_queueCount <= _options.QueueLimit); 223Debug.Assert(_options.TokensPerPeriod > 0); 224int replenishPeriods = Math.Max(replenishAmount / _options.TokensPerPeriod, 1); 226return new TokenBucketLease(false, TimeSpan.FromTicks(_options.ReplenishmentPeriod.Ticks * replenishPeriods)); 246if (_queueCount == 0 || (_queueCount > 0 && _options.QueueProcessingOrder == QueueProcessingOrder.NewestFirst)) 270if (_options.AutoReplenishment) 301if (_tokenCount == _options.TokenLimit) 309if (_options.AutoReplenishment) 311add = _options.TokensPerPeriod; 318_tokenCount = Math.Min(_options.TokenLimit, _tokenCount + add); 325Debug.Assert(_tokenCount <= _options.TokenLimit); 329_options.QueueProcessingOrder == QueueProcessingOrder.OldestFirst 338_options.QueueProcessingOrder == QueueProcessingOrder.OldestFirst 347_options.QueueProcessingOrder == QueueProcessingOrder.OldestFirst 385if (_tokenCount == _options.TokenLimit) 412RequestRegistration next = _options.QueueProcessingOrder == QueueProcessingOrder.OldestFirst