コード例 #1
0
        public SlidingWindowCacheTest()
        {
            _config = new SlidingWindowConfig <double>
            {
                PerLoadSize    = 0.61,
                StartPoint     = 11.1,
                EndPoint       = 689.7,
                TotalLoadSize  = 12,
                TotalCacheSize = 65.6
            };

            var rd = new Random();

            _cache = new SlidingWindowCache <double, double>(_config)
            {
                DataSourceDelegate = (a, b, c) =>
                {
                    return(Task.FromResult <IEnumerable <double> >(
                               Enumerable.Range(0, (int)(b - a))
                               .Select(t => rd.NextDouble())
                               .ToList()
                               ));
                },
                CurrentPoint = _config.StartPoint
            };
        }
コード例 #2
0
 public DataRequestClient(ISlidingWindowCache <long, DataModel> cache)
 {
     _cache = cache;
     _cache.OnDataAutoLoaderStatusChanged += CacheDataAutoLoaderStatusChanged;
 }