private void RefreshThrottleStrategyInCache(string requestKey, IThrottleStrategy throttleStrategy) { if (Context.Cache[requestKey] == null) { AddToCache(requestKey, throttleStrategy); } }
public Throttler(IThrottleStrategy strategy) { if (strategy == null) { throw new ArgumentNullException("strategy"); } Strategy = strategy; }
public Throttler(IThrottleStrategy strategy) { if (strategy == null) { throw new ArgumentNullException("strategy"); } this.strategy = strategy; }
private void AddToCache(string requestKey, IThrottleStrategy throttleStrategy) { Context.Cache.Add( requestKey, throttleStrategy, null, DateTime.Now.AddSeconds(CacheExpirationPeriodMilliseconds), Cache.NoSlidingExpiration, CacheItemPriority.Low, null); }
public Throttler(IThrottleStrategy strategy) { this.strategy = strategy ?? throw new ArgumentNullException(nameof(strategy)); }
public Throttler(IThrottleStrategy strategy) { Strategy = strategy ?? throw new ArgumentNullException("strategy"); }