コード例 #1
0
        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;
        }
コード例 #2
0
 public AsyncRequestHandler(IAsyncRequestHandlerCore <TRequest, TResponse> handler, FilterAttachedAsyncRequestHandlerFactory handlerFactory)
 {
     this.handler = handlerFactory.CreateAsyncRequestHandler <TRequest, TResponse>(handler);
 }