EventStore.Projections.Core.Services.Processing.ProjectionCheckpoint.ValidateOrderAndEmitEvents C# (CSharp) Метод

ValidateOrderAndEmitEvents() публичный Метод

public ValidateOrderAndEmitEvents ( EventStore.Projections.Core.Services.Processing.EmittedEventEnvelope events ) : void
events EventStore.Projections.Core.Services.Processing.EmittedEventEnvelope
Результат void
        public void ValidateOrderAndEmitEvents(EmittedEventEnvelope[] events)
        {
            UpdateLastPosition(events);
            EnsureCheckpointNotRequested();

            var groupedEvents = events.GroupBy(v => v.Event.StreamId);
            foreach (var eventGroup in groupedEvents)
            {
                EmitEventsToStream(eventGroup.Key, eventGroup.ToArray());
            }
        }

Usage Example

 public void setup()
 {
     _readyHandler = new TestCheckpointManagerMessageHandler();
     _checkpoint = new ProjectionCheckpoint(
         _ioDispatcher, new ProjectionVersion(1, 0, 0), null, _readyHandler,
         CheckpointTag.FromPosition(0, 100, 50), new TransactionFilePositionTagger(0), 250);
     _checkpoint.ValidateOrderAndEmitEvents(
         new[]
         {
             new EmittedEventEnvelope(
                 new EmittedDataEvent(
                     "stream2", Guid.NewGuid(), "type", true, "data2", null, CheckpointTag.FromPosition(0, 120, 110), null)),
             new EmittedEventEnvelope(
                 new EmittedDataEvent(
                     "stream3", Guid.NewGuid(), "type", true, "data3", null, CheckpointTag.FromPosition(0, 120, 110), null)),
             new EmittedEventEnvelope(
                 new EmittedDataEvent(
                     "stream2", Guid.NewGuid(), "type", true, "data4", null, CheckpointTag.FromPosition(0, 120, 110), null)),
         });
     _checkpoint.ValidateOrderAndEmitEvents(
         new[]
         {
             new EmittedEventEnvelope(
                 new EmittedDataEvent(
                     "stream1", Guid.NewGuid(), "type", true, "data", null, CheckpointTag.FromPosition(0, 140, 130), null))
         });
 }
All Usage Examples Of EventStore.Projections.Core.Services.Processing.ProjectionCheckpoint::ValidateOrderAndEmitEvents