Exemplo n.º 1
0
        public void Add(IEventProcessor processor)
        {
            var consumerInfo = new EventProcessorInfo <T>(processor, null, null);

            _eventProcessorInfoBySequence[processor.GetSequence()] = consumerInfo;
            _consumerInfos.Add(consumerInfo);
        }
        public void ShouldGetLastEventProcessorsInChain()
        {
            _repository.Add(_processor1, _handler1, _barrier1);
            _repository.Add(_processor2, _handler2, _barrier2);

            _repository.UnMarkEventProcessorsAsEndOfChain(_processor2.GetSequence());
            var sequences = _repository.GetLastSequenceInChain(true);

            Assert.Single(sequences);
            Assert.Equal(sequences[0], _processor1.GetSequence());
        }
Exemplo n.º 3
0
        public void Add(
            IEventProcessor processor,
            IEventHandler <T> handler,
            ISequenceBarrier barrier)
        {
            var consumerInfo = new EventProcessorInfo <T>(processor, handler, barrier);

            _eventProcessorInfoByEventHandler[handler]             = consumerInfo;
            _eventProcessorInfoBySequence[processor.GetSequence()] = consumerInfo;
            _consumerInfos.Add(consumerInfo);
        }
Exemplo n.º 4
0
 public ISequence[] GetSequences()
 {
     return(new[] { _processor.GetSequence() });
 }