public AsyncRequestAllHandler(IEnumerable <IAsyncRequestHandlerCore <TRequest, TResponse> > handlers, FilterAttachedAsyncRequestHandlerFactory handlerFactory, MessagePipeOptions options) { var collection = (handlers as ICollection <IAsyncRequestHandlerCore <TRequest, TResponse> >) ?? handlers.ToArray(); var array = new IAsyncRequestHandlerCore <TRequest, TResponse> [collection.Count]; var i = 0; foreach (var item in collection) { array[i++] = handlerFactory.CreateAsyncRequestHandler(item); } this.handlers = array; this.defaultAsyncPublishStrategy = options.DefaultAsyncPublishStrategy; }
public AsyncRequestHandler(IAsyncRequestHandlerCore <TRequest, TResponse> handler, FilterAttachedAsyncRequestHandlerFactory handlerFactory) { this.handler = handlerFactory.CreateAsyncRequestHandler <TRequest, TResponse>(handler); }