Exemple #1
0
 private async Task Reconciler_AggregateReconciled(
     IAggregateReconciler sender,
     AggregateReconciledAsyncEventArgs e)
 {
     await bus
     .PublishAsync(e.Events, cancellationToken : e.CancellationToken)
     .ConfigureAwait(false);
 }
Exemple #2
0
        public DomainEventPropagator(IBus bus, IAggregateReconciler reconciler)
        {
            this.bus = ArgumentNotNull(
                bus,
                nameof(bus),
                DomainEventPropagatorBusRequired);

            this.reconciler = ArgumentNotNull(
                reconciler,
                nameof(reconciler),
                DomainEventPropagatorReconcilerRequired);

            this.reconciler.AggregateReconciled += Reconciler_AggregateReconciled;
        }
Exemple #3
0
        public DefaultEventReconciler(
            IEventStore <TSequencedEvents, ulong> eventStore,
            IAggregateReconciler reconciler,
            ushort numberToRead = DefaultNumberToRead)
        {
            this.eventStore = ArgumentNotNull(
                eventStore,
                nameof(eventStore),
                DefaultEventReconcilerEventStoreRequired);

            this.reconciler = ArgumentNotNull(
                reconciler,
                nameof(reconciler),
                DefaultEventReconcilerReconcilerRequired);

            this.numberToRead = Math.Max(MinimumNumberToRead, numberToRead);
        }
        public DefaultReconciliationOrchestrator(
            IAggregateReconciler aggregateReconciler,
            Func <Reference, EventCentricAggregateRoot> aggregateSource,
            IEventReconciler eventReconciler,
            Func <ulong, TEventSequence> sequenceFactory,
            IStore <TEventSequence, ulong> sequenceStore,
            Func <ISnapshot> snapshotSource)
        {
            this.aggregateReconciler = ArgumentNotNull(
                aggregateReconciler,
                nameof(aggregateReconciler),
                DefaultReconciliationOrchestratorAggregateReconcilerRequired);

            this.aggregateSource = ArgumentNotNull(
                aggregateSource,
                nameof(aggregateSource),
                DefaultReconciliationOrchestratorAggregateSourceRequired);

            this.eventReconciler = ArgumentNotNull(
                eventReconciler,
                nameof(eventReconciler),
                DefaultReconciliationOrchestratorEventReconcilerRequired);

            this.sequenceFactory = ArgumentNotNull(
                sequenceFactory,
                nameof(sequenceFactory),
                DefaultReconciliationOrchestratorSequenceFactoryRequired);

            this.sequenceStore = ArgumentNotNull(
                sequenceStore,
                nameof(sequenceStore),
                DefaultReconciliationOrchestratorSequenceStoreRequired);

            this.snapshotSource = ArgumentNotNull(
                snapshotSource,
                nameof(snapshotSource),
                DefaultReconciliationOrchestratorSnapshotSourceRequired);

            this.aggregateReconciler.AggregateConflictDetected += AggregateReconciler_AggregateConflictDetected;
            this.eventReconciler.EventSequenceAdvanced         += EventReconciler_EventSequenceAdvanced;
        }