/// <summary> /// Creates a new instance of the <see cref="CommandProcessor"/> using the specified <see cref="IRetrieveCommandHandlers"/> and <see cref="IStoreAggregates"/> instances. /// </summary> /// <param name="commandHandlerRegistry">The <see cref="CommandHandler"/> registry.</param> /// <param name="transientErrorRegistry">The <see cref="IDetectTransientErrors"/> instance used to detect transient errors.</param> /// <param name="settings">The command processor configuration settings.</param> internal CommandProcessor(IRetrieveCommandHandlers commandHandlerRegistry, IDetectTransientErrors transientErrorRegistry, IProcessCommandSettings settings) { Verify.NotNull(commandHandlerRegistry, nameof(commandHandlerRegistry)); Verify.NotNull(settings, nameof(settings)); this.retryTimeout = settings.RetryTimeout; this.transientErrorRegistry = transientErrorRegistry; this.taskScheduler = new PartitionedTaskScheduler(GetAggregateId, settings.MaximumConcurrencyLevel, settings.BoundedCapacity); this.commandHandlerRegistry = commandHandlerRegistry; }
/// <summary> /// Creates a new instance of the <see cref="CommandProcessor"/> using the specified <see cref="IRetrieveCommandHandlers"/> and <see cref="IStoreAggregates"/> instances. /// </summary> /// <param name="commandHandlerRegistry">The <see cref="CommandHandler"/> registry.</param> /// <param name="transientErrorRegistries">The set of <see cref="IDetectTransientErrors"/> instances used to detect transient errors.</param> public CommandProcessor(IRetrieveCommandHandlers commandHandlerRegistry, IEnumerable <IDetectTransientErrors> transientErrorRegistries) : this(commandHandlerRegistry, new TransientErrorRegistry(transientErrorRegistries), Settings.CommandProcessor) { }