示例#1
0
        /// <summary>
        /// Creates a new instance of the <see cref="EventProcessor"/> using the specified <see cref="IRetrieveEventHandlers"/> instance.
        /// </summary>
        /// <param name="eventHandlerRegistry">The <see cref="EventHandler"/> registry.</param>
        /// <param name="transientErrorRegistry">The <see cref="IDetectTransientErrors"/> instance used to detect transient errors.</param>
        /// <param name="settings">The event processor configuration settings.</param>
        internal EventProcessor(IRetrieveEventHandlers eventHandlerRegistry, IDetectTransientErrors transientErrorRegistry, IProcessEventSettings settings)
        {
            Verify.NotNull(eventHandlerRegistry, nameof(eventHandlerRegistry));
            Verify.NotNull(settings, nameof(settings));

            this.retryTimeout           = settings.RetryTimeout;
            this.eventHandlerRegistry   = eventHandlerRegistry;
            this.transientErrorRegistry = transientErrorRegistry;
            this.taskScheduler          = new PartitionedTaskScheduler(GetAggregateId, settings.MaximumConcurrencyLevel, settings.BoundedCapacity);
        }
示例#2
0
 /// <summary>
 /// Creates a new instance of the <see cref="EventProcessor"/> using the specified <see cref="IRetrieveEventHandlers"/> instance.
 /// </summary>
 /// <param name="eventHandlerRegistry">The <see cref="EventHandler"/> registry.</param>
 /// <param name="transientErrorRegistries">The set of <see cref="IDetectTransientErrors"/> instances used to detect transient errors.</param>
 public EventProcessor(IRetrieveEventHandlers eventHandlerRegistry, IEnumerable <IDetectTransientErrors> transientErrorRegistries)
     : this(eventHandlerRegistry, new TransientErrorRegistry(transientErrorRegistries), Settings.EventProcessor)
 {
 }