private GainCapitalRatesProvider(IHubConnectionContext clients)
        {
            _wrapper = DependencyFactory.Container.Resolve <ILoggerWrapper>();

            _gainCapitalRatesService = DependencyFactory.Container.Resolve <IGainCapitalRatesManager>();
            _gainCapitalRatesService.StartProcessing();

            _customerInfo   = DependencyFactory.Container.Resolve <ICustomerInfoProvider>();
            _spreadProvider = DependencyFactory.Container.Resolve <IRatesSpreadService>();

            _updateInterval = TimeSpan.FromMilliseconds(Int32.Parse(ConfigurationManager.AppSettings["UpdateInterval"]));

            _timers = new Dictionary <string, Timer>();

            Clients = clients;
        }
		private GainCapitalRatesProvider(IHubConnectionContext clients)
		{
			_wrapper = DependencyFactory.Container.Resolve<ILoggerWrapper>();

			_gainCapitalRatesService = DependencyFactory.Container.Resolve<IGainCapitalRatesManager>();
			_gainCapitalRatesService.StartProcessing();

			_customerInfo = DependencyFactory.Container.Resolve<ICustomerInfoProvider>();
			_spreadProvider = DependencyFactory.Container.Resolve<IRatesSpreadService>();

			_updateInterval = TimeSpan.FromMilliseconds(Int32.Parse(ConfigurationManager.AppSettings["UpdateInterval"]));

			_timers = new Dictionary<string, Timer>();

			Clients = clients;
		}
        public void StartQuoting(string connectionId, int customerId)
        {
            if (!_gainCapitalRatesService.IsRunning)
            {
                _gainCapitalRatesService.StartProcessing();
            }

            var parameters = new QuotingParameters {
                ConnectionId = connectionId, CustomerId = customerId
            };

            var timer = new Timer(UpdateQuotes, parameters, _updateInterval, _updateInterval);

            _timers.Add(connectionId, timer);

            BroadcastMarketOpened(connectionId);
        }