예제 #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="SagaEventHandler"/>.
        /// </summary>
        /// <param name="eventHandler">The base event handler to decorate.</param>
        /// <param name="sagaMetadata">The saga metadata associated with this saga event handler.</param>
        /// <param name="sagaStore">The saga store used to load/save saga state.</param>
        /// <param name="commandPublisher">The command publisher used to publish saga commands.</param>
        /// <param name="settings">The event processor settings.</param>
        internal SagaEventHandler(EventHandler eventHandler, SagaMetadata sagaMetadata, IStoreSagas sagaStore, Lazy <IPublishCommands> commandPublisher, IStoreSagaSettings settings)
            : base(eventHandler)
        {
            Verify.NotNull(sagaStore, nameof(sagaStore));
            Verify.NotNull(sagaMetadata, nameof(sagaMetadata));
            Verify.NotNull(commandPublisher, nameof(commandPublisher));
            Verify.NotNull(settings, nameof(settings));

            this.sagaStore            = sagaStore;
            this.sagaMetadata         = sagaMetadata;
            this.lazyCommandPublisher = commandPublisher;
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="SagaEventHandler"/>.
 /// </summary>
 /// <param name="eventHandler">The base event handler to decorate.</param>
 /// <param name="sagaMetadata">The saga metadata associated with this saga event handler.</param>
 /// <param name="sagaStore">The saga store used to load/save saga state.</param>
 /// <param name="commandPublisher">The command publisher used to publish saga commands.</param>
 internal SagaEventHandler(EventHandler eventHandler, SagaMetadata sagaMetadata, IStoreSagas sagaStore, Lazy <IPublishCommands> commandPublisher)
     : this(eventHandler, sagaMetadata, sagaStore, commandPublisher, Settings.SagaStore)
 {
 }