Example #1
0
        public void Run()
        {
            Console.Clear();

            var inspectionResult = _selfInspectionService.Inspect();

            if (!inspectionResult.IsSuccessful)
            {
                Console.WriteLine(inspectionResult.Message);
                Console.WriteLine("Press any key to quit");
                Console.ReadKey();
                return;
            }

            Console.WriteLine("Prease any key to start it");
            Console.ReadKey();
            Console.Clear();

            var observations  = _observationService.GetObservations();
            var currencyPairs = observations.Select(it => it.CurrencyPair).ToList();

            _exchangeDataService.Register(currencyPairs);
            _exchangeDataService.Start();
            _worker.Add(observations);


            Console.ReadLine();
            Console.ReadLine();
        }
Example #2
0
        /// <summary>
        /// Start data service, add default observations
        /// </summary>
        public void Run()
        {
            //Todo: create a service scope for each run times. else if many records are added in to coinContext. the Performance will deteriorate
            var observations = _observationService.GetObservations();
            ///Todo: Improve  if a new observatoin is added. we can register a new currencypair
            var currencyPairs = new List <CurrencyPair>()
            {
                CurrencyPair.BtcEur, CurrencyPair.LtcEur
            };

            _exchangeDataService.Register(currencyPairs);
            _exchangeDataService.Start();
            _worker.Add(observations);

            var wssv = new WebSocketServer(4888);

            wssv.AddWebSocketService <MessageBehavior>("/message");
            wssv.Start();
            var enviromnent = _appSettings.Production ? "production" : "test";

            Console.WriteLine($"{enviromnent} enviroment");
        }