public ICMTickPriceHarvester(
            ICMAdapterSettings config,
            ICMModelConverter modelConverter,
            IHandler <TickPrice> tickPriceHandler,
            IHandler <TradingOrderBook> orderBookHandler,
            IThrottling orderBooksThrottler,
            IThrottling tickPriceThrottler,
            RepeatingTicksFilter repeatingTicksFilter,
            ILog log)
        {
            _config           = config;
            _modelConverter   = modelConverter;
            _tickPriceHandler = tickPriceHandler;
            _orderBookHandler = orderBookHandler;

            _orderBooksThrottler  = orderBooksThrottler;
            _tickPricesThrottler  = tickPriceThrottler;
            _repaetingTicksFilter = repeatingTicksFilter;

            _log = log;

            _instruments = config.SupportedCurrencySymbols.Select(x => new Instrument(x.LykkeSymbol).Name).ToHashSet();
            var rabbitSettings = new RabbitMqSubscriptionSettings
            {
                ConnectionString = config.RabbitMq.SourceFeed.ConnectionString,
                ExchangeName     = config.RabbitMq.SourceFeed.Exchange,
                QueueName        = config.RabbitMq.SourceFeed.Queue
            };
            var errorStrategy = new DefaultErrorHandlingStrategy(_log, rabbitSettings);

            _rabbit = new RabbitMqSubscriber <ICMOrderBook>(rabbitSettings, errorStrategy)
                      .SetMessageDeserializer(new GenericRabbitModelConverter <ICMOrderBook>())
                      .SetMessageReadStrategy(new MessageReadWithTemporaryQueueStrategy())
                      .SetConsole(new LogToConsole())
                      .SetLogger(_log)
                      .Subscribe(HandleOrderBook);
        }
Пример #2
0
 /// <summary>
 /// Register this instance with throttling container
 /// </summary>
 public void Register(IThrottling throttling)
 {
     throttling.RegisterThrottle(this);
 }
Пример #3
0
 /// <summary>
 /// Register this instance with throttling container
 /// </summary>
 public void Register(IThrottling throttling)
 {
     throttling.RegisterThrottle(this);
 }
Пример #4
0
 public MultiThreadedCompressionRunner(IThrottling throttling)
 {
     Throttling = throttling ?? throw new ArgumentNullException(nameof(throttling));
 }