コード例 #1
0
ファイル: TimerWheel.cs プロジェクト: randyklex/caffeine.net
        public TimerWheel(BoundedLocalCache <K, V> cache)
        {
            this.cache = cache ?? throw new ArgumentNullException("cache", "cache cannot be null.");

            wheel = new Node <K, V> [BUCKETS.Length][];

            for (int i = 0; i < wheel.Length; i++)
            {
                wheel[i] = new Node <K, V> [BUCKETS[i]];
                for (int j = 0; j < wheel[i].Length; j++)
                {
                    wheel[i][j] = new Sentinel <K, V>();
                }
            }
        }
コード例 #2
0
 public BoundedPolicy(BoundedLocalCache <K, V> cache, Func <V, V> transformer, bool isWeighted)
 {
     this.transformer = transformer;
     this.isWeighted  = isWeighted;
     this.cache       = cache;
 }