public void OnCompleted()
            {
                string name = _producer.Name;

                _producer.Dispose();
                _log.Debug(LoggerContext.New(name), "Killed.");
            }
        public IMessageConsumer <MessageEx> CreateConsumer(IMessageSource <MessageEx> messageSource)
        {
            if (!_stopwatch.IsRunning)
            {
                _stopwatch.Start();
            }
            Interlocked.Increment(ref _childrenCount);
            var consumer = new MessageConsumer <MessageEx>(messageSource, Scheduler.ThreadPool, _log);

            consumer.AddObserver(new StopwatchObserver <MessageEx>(_stopwatch, s => _log.Debug(LoggerContext.New(consumer.Name), s), s => _log.Info(LoggerContext.New(consumer.Name), s), e => _log.Error(LoggerContext.New(consumer.Name), string.Empty, e), null, () => Interlocked.Decrement(ref _childrenCount) == 0));
            return(consumer);
        }
Esempio n. 3
0
		public override void Produce(MessageEx message)
		{
			Send(message.Message);
			_log.Debug(LoggerContext.New(Name), "msg was routed to child queue.");
		}