Example #1
0
 /// <summary>
 /// Create a new event handler group that combines the handlers in this group with <paramref name="processors"/>.
 /// </summary>
 /// <param name="processors">the processors to combine</param>
 /// <returns>a new EventHandlerGroup combining the existing and new processors into a single dependency group</returns>
 public EventHandlerGroup <T> And(params IEventProcessor[] processors)
 {
     foreach (var eventProcessor in processors)
     {
         _consumerRepository.Add(eventProcessor);
     }
     return(new EventHandlerGroup <T>(_disruptor, _consumerRepository, processors.Select(p => p.Sequence).Concat(_sequences)));
 }
        public void ShouldGetBarrierByHandler()
        {
            _repository.Add(_processor1, _handler1, _barrier1);
            var barrier2 = _repository.GetBarrierFor(_handler1);

            Assert.Equal(barrier2, _barrier1);
        }
        public async Task <bool> AddConsumer(DTOConsumer consumer)
        {
            Consumer mapConsumer = _mapper.Map <Consumer>(consumer);

            _consumerRepository.Add(mapConsumer);
            bool success = true;

            try
            {
                await _consumerRepository.SaveChanges();
            }
            catch
            {
                success = false;
            }

            return(success);
        }
        public void ShouldGetBarrierByHandler()
        {
            _consumerRepository.Add(_eventProcessor1, _handler1, _barrier1);

            Assert.That(_consumerRepository.GetBarrierFor(_handler1), Is.SameAs(_barrier1));
        }
 public void ShouldGetBarrierByHandler()
 {
     consumerRepository.Add(eventProcessorMock1.Object, handler1, barrier1.Object);
     Assert.AreEqual(consumerRepository.GetBarrierFor(handler1), barrier1.Object);
 }
Example #6
0
        public void ShouldGetBarrierByHandler()
        {
            _consumerRepository.Add(_eventProcessor1.Object, _handler1, _barrier1.Object);

            Assert.That(_consumerRepository.GetBarrierFor(_handler1), Is.EqualTo(_barrier1.Object));
        }