Exemplo n.º 1
0
 public BatchThunderingHerdProtection(IBatchDataSource <TKey, TValue> dataSource) : base(dataSource)
 {
     _batchDataSource = dataSource;
 }
Exemplo n.º 2
0
        readonly IBatchDataSource <TKey, TValue> _dataSource;      // the underlying source of values

        /// <summary>Create a new read-through cache that has a Gen0 size limit and/or a periodic collection time</summary>
        /// <param name="dataSource">The underlying source to load data from</param>
        /// <param name="gen0Limit">(Optional) limit on the number of items allowed in Gen0 before a collection</param>
        /// <param name="timeToLive">(Optional) time period after which a unread item is evicted from the cache</param>
        public BatchReadThroughCache(IBatchDataSource <TKey, TValue> dataSource, int?gen0Limit, TimeSpan?timeToLive)
            : base(dataSource, gen0Limit, timeToLive)
        {
            _dataSource = dataSource;
        }