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); }
public RequestConsumerAdapter(IRequestConsumer <TRequest, TResponse> consumer) { Guard.NotNull(consumer, nameof(consumer)); this.consumer = consumer; }
public MessageWorker(IRequestConsumer <MercuryRequest <ExpandoObject> > consumer, IMercuryFacade mercuryFacade, ILogger <MessageWorker> logger) { this.consumer = consumer; this.mercuryFacade = mercuryFacade; this.logger = logger; }