1 write to _options
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (1)
72_options = new TokenBucketRateLimiterOptions
30 references to _options
System.Threading.RateLimiting (30)
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (30)
40public override bool IsAutoReplenishing => _options.AutoReplenishment; 43public override TimeSpan ReplenishmentPeriod => _options.ReplenishmentPeriod; 87if (_options.AutoReplenishment) 89_renewTimer = new Timer(Replenish, this, _options.ReplenishmentPeriod, _options.ReplenishmentPeriod); 110if (tokenCount > _options.TokenLimit) 112throw new ArgumentOutOfRangeException(nameof(tokenCount), tokenCount, SR.Format(SR.TokenLimitExceeded, tokenCount, _options.TokenLimit)); 144if (tokenCount > _options.TokenLimit) 146throw new ArgumentOutOfRangeException(nameof(tokenCount), tokenCount, SR.Format(SR.TokenLimitExceeded, tokenCount, _options.TokenLimit)); 167Debug.Assert(_options.QueueLimit >= _queueCount); 168if (_options.QueueLimit - _queueCount < tokenCount) 170if (_options.QueueProcessingOrder == QueueProcessingOrder.NewestFirst && tokenCount <= _options.QueueLimit) 198while (_options.QueueLimit - _queueCount < tokenCount); 211Debug.Assert(_queueCount <= _options.QueueLimit); 222Debug.Assert(_options.TokensPerPeriod > 0); 223int replenishPeriods = Math.Max(replenishAmount / _options.TokensPerPeriod, 1); 225return new TokenBucketLease(false, TimeSpan.FromTicks(_options.ReplenishmentPeriod.Ticks * replenishPeriods)); 245if (_queueCount == 0 || (_queueCount > 0 && _options.QueueProcessingOrder == QueueProcessingOrder.NewestFirst)) 269if (_options.AutoReplenishment) 300if (_tokenCount == _options.TokenLimit) 308if (_options.AutoReplenishment) 310add = _options.TokensPerPeriod; 317_tokenCount = Math.Min(_options.TokenLimit, _tokenCount + add); 324Debug.Assert(_tokenCount <= _options.TokenLimit); 328_options.QueueProcessingOrder == QueueProcessingOrder.OldestFirst 337_options.QueueProcessingOrder == QueueProcessingOrder.OldestFirst 346_options.QueueProcessingOrder == QueueProcessingOrder.OldestFirst 384if (_tokenCount == _options.TokenLimit) 411RequestRegistration next = _options.QueueProcessingOrder == QueueProcessingOrder.OldestFirst