Skip to content

TokenBucketOptions

TokenBucketOptions configures the per-endpoint token-bucket limiter.

Source mapping

  • src/Nalix.Network/Configurations/TokenBucketOptions.cs

What it controls

  • bucket capacity
  • refill rate
  • hard lockout duration
  • cleanup cadence
  • stale entry timeout
  • token precision
  • shard count
  • soft-violation escalation behavior
  • maximum tracked endpoints

Basic usage

TokenBucketOptions options = ConfigurationManager.Instance.Get<TokenBucketOptions>();
options.Validate();

Important note

ShardCount must be a power of two in the current implementation.