public QueryConsumer(IMessageReceiver <Envelope <IQuery> > receiver, IMessageBus <IResult> resultBus) : base(receiver, ProcessingFlags.Query) { _handlerDescriptors = new Dictionary <Type, HandlerDescriptor>(); _pipelineManager = new HandlerPipelineManager(); _resultBus = resultBus; var threadCount = ConfigurationSettings.ParallelQueryThead; if (threadCount > 1) { _semaphore = new SemaphoreSlim(threadCount, threadCount); } }
/// <summary> /// Initializes a new instance of the <see cref="CommandConsumer" /> class. /// </summary> public CommandConsumer( IMessageBus <IPublishableException> exceptionBus, IMessageBus <IResult> resultBus, IRepository repository, ITextSerializer serializer, IMessageReceiver <Envelope <ICommand> > commandReceiver) : base(commandReceiver, CheckHandlerMode.OnlyOne, ProcessingFlags.Command) { _exceptionBus = exceptionBus; _resultBus = resultBus; _repository = repository; _serializer = serializer; _commandHandlerDescriptors = new Dictionary <Type, HandlerDescriptor>(); _pipelineManager = new HandlerPipelineManager(); }