コード例 #1
0
 // Token: 0x060071E2 RID: 29154 RVA: 0x001792A4 File Offset: 0x001774A4
 private void InternalUpdateCachedPolicyValues(bool resetBudgetValues)
 {
     lock (this.SyncRoot)
     {
         this.casTokenBucket = TokenBucket.Create(resetBudgetValues ? null : this.casTokenBucket, this.ThrottlingPolicy.MaxBurst, this.ThrottlingPolicy.RechargeRate, this.ThrottlingPolicy.CutoffBalance, this.Owner);
     }
     this.UpdateCachedPolicyValues(resetBudgetValues);
 }
コード例 #2
0
        public static ITokenBucket Create(ITokenBucket tokenBucket, Unlimited <uint> maxBalance, Unlimited <uint> rechargeRate, Unlimited <uint> minBalance, BudgetKey budgetKey)
        {
            if (rechargeRate == 0U)
            {
                return(new FullyThrottledTokenBucket(tokenBucket));
            }
            if (rechargeRate == 2147483647U || rechargeRate.IsUnlimited)
            {
                return(new UnthrottledTokenBucket(tokenBucket));
            }
            TokenBucket tokenBucket2 = tokenBucket as TokenBucket;

            if (tokenBucket2 != null && tokenBucket2.BudgetKey == budgetKey)
            {
                tokenBucket2.UpdateSettings(maxBalance, rechargeRate, minBalance);
                return(tokenBucket);
            }
            return(new TokenBucket(tokenBucket, maxBalance, rechargeRate, minBalance, budgetKey));
        }
コード例 #3
0
 public static ITokenBucket Create(Unlimited <uint> maxBalance, Unlimited <uint> rechargeRate, Unlimited <uint> minBalance, BudgetKey budgetKey)
 {
     return(TokenBucket.Create(null, maxBalance, rechargeRate, minBalance, budgetKey));
 }