示例#1
0
        public int AddConsumer(IRequestConsumer consumer)
        {
            if (requestBag == null)
            {
                requestBag = new Dictionary <IRequestOptions, IList <IRequestConsumer> >();
            }
            var requestOptions = consumer.GetRequestOptions();

            if (!requestBag.ContainsKey(requestOptions))
            {
                requestBag.Add(requestOptions, new List <IRequestConsumer>());
            }
            requestBag[requestOptions].Add(consumer);
            return(requestBag.Count);
        }
示例#2
0
 public RequestConsumerAdapter(IRequestConsumer <TRequest, TResponse> consumer)
 {
     Guard.NotNull(consumer, nameof(consumer));
     this.consumer = consumer;
 }
示例#3
0
 public MessageWorker(IRequestConsumer <MercuryRequest <ExpandoObject> > consumer, IMercuryFacade mercuryFacade, ILogger <MessageWorker> logger)
 {
     this.consumer      = consumer;
     this.mercuryFacade = mercuryFacade;
     this.logger        = logger;
 }