Bert.RateLimiters.TokenBucket.TokenBucket C# (CSharp) Метод

TokenBucket() защищенный Метод

protected TokenBucket ( long bucketTokenCapacity, long refillInterval, long refillIntervalInMilliSeconds ) : System
bucketTokenCapacity long
refillInterval long
refillIntervalInMilliSeconds long
Результат System
        protected TokenBucket(long bucketTokenCapacity, long refillInterval, long refillIntervalInMilliSeconds)
        {
            if (bucketTokenCapacity <= 0) throw new ArgumentOutOfRangeException("bucketTokenCapacity", "bucket token capacity can not be negative");
            if (refillInterval < 0) throw new ArgumentOutOfRangeException("refillInterval", "Refill interval cannot be negative");
            if (refillIntervalInMilliSeconds <= 0) throw new ArgumentOutOfRangeException("refillIntervalInMilliSeconds", "Refill interval in milliseconds cannot be negative");

            this.bucketTokenCapacity = bucketTokenCapacity;
            ticksRefillInterval = TimeSpan.FromMilliseconds(refillInterval * refillIntervalInMilliSeconds).Ticks;
        }