Ejemplo n.º 1
0
        public IEnumerable <Action <IConsumeContext <Distributed <TMessage> > > > GetWorker(
            IConsumeContext <Distributed <TMessage> > context,
            MultipleHandlerSelector <Distributed <TMessage> > selector)
        {
            _pending.Viewed(context.Message.CorrelationId);

            return(selector(context)
                   .Select(handler => (Action <IConsumeContext <Distributed <TMessage> > >)(x => Handle(x, handler))));
        }
Ejemplo n.º 2
0
        public bool Accept(Distributed <T> message)
        {
            if (_inProgress >= _inProgressLimit)
            {
                _pendingMessages.Viewed(message.CorrelationId);
                return(false);
            }

            return(true);
        }