-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
41 lines (37 loc) · 1.23 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Threading.Tasks;
using SlidingWindowCache.Core.Configuration;
using SlidingWindowCache.Core.Cache;
namespace SlidingWindowCache.ConsoleApp
{
class Program
{
static async Task Main(string[] args)
{
var timeConf = new SlidingWindowConfig<long>
{
PerLoadSize = new TimeSpan(0, 2, 0).Ticks,
StartPoint = new DateTime(2019, 1, 1).Ticks,
EndPoint = new DateTime(2019, 2, 1).Ticks,
TotalLoadSize = new TimeSpan(0, 30, 0).Ticks,
TotalCacheSize = new TimeSpan(1, 0, 0).Ticks
};
var win = new SlidingWindowCache<long, DataModel>(timeConf)
{
DataSourceDelegate = DataModel.Instance.LoadDataFromSource,
CurrentPoint = timeConf.StartPoint
};
var client = new DataRequestClient(win)
{
DiffSize = new TimeSpan(0, 1, 0).Ticks
};
while (true)
{
var key = Console.ReadKey().Key;
// var key = ConsoleKey.RightArrow;
// Task.Delay(200).Wait();
await client.DoWork(key);
}
}
}
}