protected override void SymbolProcessorTaskWork()
        {
            MarketDataLogger.EnableFileLogging(ProviderId);
            var thirdpartyprocessor = new ThirdPartyDelayProcessor();

            try
            {
                Parallel.ForEach(dataQueueAggregator.GetConsumingEnumerable(), data =>
                {
                    data.Processors.Add(new AverageProcessor(data.Symbol));
                    data.Processors.Add(thirdpartyprocessor);

                    data.PublishSymbolTicks(PublishMarketData);
                });
            }
            catch (AggregateException e)
            {
                foreach (var t in e.InnerExceptions)
                {
                    Trace.WriteLine("\n-------------------------------------------------\n{0}", t.ToString());
                }
            }
            finally
            {
                MarketDataLogger.Dispose();
            }
        }
예제 #2
0
        protected virtual void SymbolProcessorTaskWork()
        {
            var delay = new ThirdPartyDelayProcessor();
            Parallel.ForEach(dataQueue.GetConsumingEnumerable(), (data, loopState) =>
                {
                    if (IsCancellationRequested)
                        return; // loopState.Stop();

                    data.Processors.Add(delay);
                    data.PublishSymbolTicks(OnNewDataReceived, _cts.Token);

                });
        }