Beispiel #1
0
        public void CacheFillGapTest()
        {
            var client       = new BitFlyerClient();
            var cacheFactory = new SqlServerCacheFactory(@"server=(local);Initial Catalog=bitflyer;Integrated Security=True");
            var cache        = cacheFactory.CreateExecutionCache(BfProductCode.FXBTCJPY);
            var completed    = new ManualResetEvent(false);
            var recentTime   = DateTime.UtcNow;

            cache.FillGaps(client).Subscribe(exec =>
            {
                if (exec.ExecutedTime.Day != recentTime.Day)
                {
                    recentTime = exec.ExecutedTime;
                    Console.WriteLine("{0} Completed", recentTime.ToLocalTime().Date);
                }
            },
                                             () =>
            {
                completed.Set();
            });
            completed.WaitOne();
        }