コード例 #1
0
 public static CommittedEventReceived FromCommittedEventDistributed(
     ReaderSubscriptionMessage.CommittedEventDistributed message, CheckpointTag checkpointTag,
     string eventCategory, Guid subscriptionId, long subscriptionMessageSequenceNumber)
 {
     return(new CommittedEventReceived(
                subscriptionId, checkpointTag, eventCategory, message.Data, message.Progress,
                subscriptionMessageSequenceNumber, message.Source));
 }
コード例 #2
0
 public void setup()
 {
     _zeroEvent = ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
         Guid.NewGuid(), new TFPos(10, 0), "stream1", 0, false, Guid.NewGuid(), "StreamCreated", false,
         new byte[0], new byte[0]);
     _firstEvent = ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
         Guid.NewGuid(), new TFPos(30, 20), "stream1", 1, false, Guid.NewGuid(), "Data", true,
         Helper.UTF8NoBom.GetBytes("{}"), new byte[0]);
     _secondEvent = ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
         Guid.NewGuid(), new TFPos(50, 40), "stream1", 2, false, Guid.NewGuid(), "Data", true,
         Helper.UTF8NoBom.GetBytes("{}"), new byte[0]);
 }
コード例 #3
0
        public void setup()
        {
            _zeroEvent = ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                Guid.NewGuid(), new TFPos(-1, 120), new TFPos(20, 10), "$et-type1", 0, "stream1", 0, true,
                Guid.NewGuid(), "type1", true, Helper.UTF8NoBom.GetBytes("{}"), new byte[0], null, 10f);

            _firstEvent = ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                Guid.NewGuid(), new TFPos(-1, 130), new TFPos(30, 20), "$et-type2", 0, "stream1", 1, true,
                Guid.NewGuid(), "type2", true, Helper.UTF8NoBom.GetBytes("{}"), new byte[0], null, 20f);

            _secondEvent = ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                Guid.NewGuid(), new TFPos(-1, 140), new TFPos(50, 40), "$et-type1", 1, "stream2", 0, false,
                Guid.NewGuid(), "type1", true, Helper.UTF8NoBom.GetBytes("{}"), new byte[0], null, 30f);

            _thirdEvent = ReaderSubscriptionMessage.CommittedEventDistributed.Sample(
                Guid.NewGuid(), new TFPos(-1, 150), new TFPos(70, 60), "$et-type2", 1, "stream2", 1, false,
                Guid.NewGuid(), "type2", true, Helper.UTF8NoBom.GetBytes("{}"), new byte[0], null, 40f);


        }
コード例 #4
0
 protected void SendPrerecordedEvent(
     EventStore.Core.Data.ResolvedEvent pair, CheckpointTag positionTag,
     long prerecordedEventMessageSequenceNumber)
 {
     var committedEvent = new ReaderSubscriptionMessage.CommittedEventDistributed(
         Guid.Empty, new ResolvedEvent(pair, null), null, -1, source: this.GetType());
     _publisher.Publish(
         EventReaderSubscriptionMessage.CommittedEventReceived.FromCommittedEventDistributed(
             committedEvent, positionTag, null, _projectionCorrelationId, 
             prerecordedEventMessageSequenceNumber));
 }
コード例 #5
0
 protected void SendPrerecordedEvent(
     EventStore.Core.Data.ResolvedEvent pair, CheckpointTag positionTag,
     long prerecordedEventMessageSequenceNumber)
 {
     var position = pair.OriginalEvent;
     var committedEvent = new ReaderSubscriptionMessage.CommittedEventDistributed(
         Guid.Empty,
         new ResolvedEvent(
             position.EventStreamId, position.EventNumber, pair.Event.EventStreamId, pair.Event.EventNumber,
             pair.Link != null, new TFPos(-1, position.LogPosition), new TFPos(-1, pair.Event.LogPosition),
             pair.Event.EventId, pair.Event.EventType, (pair.Event.Flags & PrepareFlags.IsJson) != 0,
             pair.Event.Data, pair.Event.Metadata, pair.Link == null ? null : pair.Link.Metadata, null,
             pair.Event.TimeStamp), null, -1, source: this.GetType());
     _publisher.Publish(
         EventReaderSubscriptionMessage.CommittedEventReceived.FromCommittedEventDistributed(
             committedEvent, positionTag, null, _projectionCorrelationId, 
             prerecordedEventMessageSequenceNumber));
 }
コード例 #6
0
 public CommittedEventItem(ReaderSubscriptionMessage.CommittedEventDistributed message)
     : base(message.Data.Position)
 {
     Message = message;
 }