当前位置: 首页>>代码示例>>C#>>正文


C# ReaderSubscriptionMessage类代码示例

本文整理汇总了C#中ReaderSubscriptionMessage的典型用法代码示例。如果您正苦于以下问题:C# ReaderSubscriptionMessage类的具体用法?C# ReaderSubscriptionMessage怎么用?C# ReaderSubscriptionMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ReaderSubscriptionMessage类属于命名空间,在下文中一共展示了ReaderSubscriptionMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Handle

 public void Handle(ReaderSubscriptionMessage.EventReaderPartitionDeleted message)
 {
     if (!base._eventFilter.DeletedNotificationPasses(message.PositionStreamId))
         return;
     var deletePosition = _positionTagger.MakeCheckpointTag(_positionTracker.LastTag, message);
     PublishPartitionDeleted(message.Partition, deletePosition);
 }
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:7,代码来源:ReaderSubscription.cs

示例2: IsMessageAfterCheckpointTag

 public override bool IsMessageAfterCheckpointTag(
     CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
 {
     if (previous.Phase < Phase)
         return true;
     return committedEvent.Data.Position.PreparePosition > previous.PreparePosition;
 }
开发者ID:msbahrul,项目名称:EventStore,代码行数:7,代码来源:PreparePositionTagger.cs

示例3: IsMessageAfterCheckpointTag

 public override bool IsMessageAfterCheckpointTag(
     CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
 {
     if (previous.Mode_ != CheckpointTag.Mode.Position)
         throw new ArgumentException("Mode.Position expected", "previous");
     return committedEvent.Data.Position > previous.Position;
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:7,代码来源:TransactionFilePositionTagger.cs

示例4: IsMessageAfterCheckpointTag

 public override bool IsMessageAfterCheckpointTag(
     CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
 {
     if (previous.Mode_ != CheckpointTag.Mode.Stream)
         throw new ArgumentException("Mode.Stream expected", "previous");
     return committedEvent.Data.PositionStreamId == _stream
            && committedEvent.Data.PositionSequenceNumber > previous.Streams[_stream];
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:8,代码来源:StreamPositionTagger.cs

示例5: Handle

 public bool Handle(ReaderSubscriptionMessage.EventReaderIdle message)
 {
     EnsureStarted();
     if (message.CorrelationId != _eventReaderId)
         return false;
     DistributeMessage(message);
     return true;
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:8,代码来源:HeadingEventReader.cs

示例6: MakeCheckpointTag

 public override CheckpointTag MakeCheckpointTag(
     CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
 {
     if (!_streams.Contains(committedEvent.Data.PositionStreamId))
         throw new InvalidOperationException(
             string.Format("Invalid stream '{0}'", committedEvent.Data.EventStreamId));
     return previous.UpdateStreamPosition(
         committedEvent.Data.PositionStreamId, committedEvent.Data.PositionSequenceNumber);
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:9,代码来源:MultiStreamPositionTagger.cs

示例7: MakeCheckpointTag

        public override CheckpointTag MakeCheckpointTag(
            CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
        {
            if (previous.Phase != Phase)
                throw new ArgumentException(
                    string.Format("Invalid checkpoint tag phase.  Expected: {0} Was: {1}", Phase, previous.Phase));

            return CheckpointTag.FromPosition(previous.Phase, committedEvent.Data.Position);
        }
开发者ID:msbahrul,项目名称:EventStore,代码行数:9,代码来源:TransactionFilePositionTagger.cs

示例8: IsMessageAfterCheckpointTag

 public override bool IsMessageAfterCheckpointTag(
     CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
 {
     if (previous.Phase < Phase)
         return true;
     if (previous.Mode_ != CheckpointTag.Mode.MultiStream)
         throw new ArgumentException("Mode.MultiStream expected", "previous");
     return _streams.Contains(committedEvent.Data.PositionStreamId)
            && committedEvent.Data.PositionSequenceNumber > previous.Streams[committedEvent.Data.PositionStreamId];
 }
开发者ID:nchistyakov,项目名称:EventStore-1,代码行数:10,代码来源:MultiStreamPositionTagger.cs

示例9: IsMessageAfterCheckpointTag

        public override bool IsMessageAfterCheckpointTag(
            CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
        {
            if (committedEvent.PreTagged == null)
                throw new ArgumentException("committedEvent.PreTagged == null", "committedEvent");
            if (previous.Phase < Phase)
                return true;

            return committedEvent.PreTagged > previous;
        }
开发者ID:msbahrul,项目名称:EventStore,代码行数:10,代码来源:PreTaggedPositionTagger.cs

示例10: IsMessageAfterCheckpointTag

        public override bool IsMessageAfterCheckpointTag(
            CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
        {
            if (previous.Mode_ != CheckpointTag.Mode.EventTypeIndex)
                throw new ArgumentException("Mode.EventTypeIndex expected", "previous");
            if (committedEvent.Data.OriginalPosition.CommitPosition <= 0)
                throw new ArgumentException("complete TF position required", "committedEvent");

            return committedEvent.Data.OriginalPosition > previous.Position;
        }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:10,代码来源:EventByTypeIndexPositionTagger.cs

示例11: MakeCheckpointTag

 public override CheckpointTag MakeCheckpointTag(
     CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
 {
     if (committedEvent.Data.PositionStreamId != _stream)
         throw new InvalidOperationException(
             string.Format(
                 "Invalid stream '{0}'.  Expected stream is '{1}'", committedEvent.Data.EventStreamId, _stream));
     return CheckpointTag.FromStreamPosition(
         committedEvent.Data.PositionStreamId, committedEvent.Data.PositionSequenceNumber);
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:10,代码来源:StreamPositionTagger.cs

示例12: MakeCheckpointTag

        public override CheckpointTag MakeCheckpointTag(CheckpointTag previous, ReaderSubscriptionMessage.EventReaderPartitionDeleted partitionDeleted)
        {
            if (previous.Phase != Phase)
                throw new ArgumentException(
                    string.Format("Invalid checkpoint tag phase.  Expected: {0} Was: {1}", Phase, previous.Phase));

            if (partitionDeleted.DeleteLinkOrEventPosition == null)
                throw new ArgumentException("Invalid partiton deleted message. deleteEventOrLinkTargetPosition required");

            return CheckpointTag.FromPosition(previous.Phase, partitionDeleted.DeleteLinkOrEventPosition.Value);
        }
开发者ID:danieldeb,项目名称:EventStore,代码行数:11,代码来源:TransactionFilePositionTagger.cs

示例13: MakeCheckpointTag

        public override CheckpointTag MakeCheckpointTag(CheckpointTag previous, ReaderSubscriptionMessage.EventReaderPartitionEof partitionEof)
        {
            if (partitionEof.PreTagged == null)
                throw new ArgumentException("committedEvent.PreTagged == null", "committedEvent");

            if (previous.Phase != Phase)
                throw new ArgumentException(
                    string.Format("Invalid checkpoint tag phase.  Expected: {0} Was: {1}", Phase, previous.Phase));

            return partitionEof.PreTagged;
        }
开发者ID:msbahrul,项目名称:EventStore,代码行数:11,代码来源:PreTaggedPositionTagger.cs

示例14: Handle

 public void Handle(ReaderSubscriptionMessage.CommittedEventDistributed message)
 {
     if (message.Data == null)
         throw new NotSupportedException();
     ReaderSubscriptionMessage.CommittedEventDistributed existing;
     // ignore duplicate messages (when replaying from heading event distribution point)
     if (!_buffer.TryGetValue(message.Data.Position.PreparePosition, out existing))
     {
         _buffer.Add(message.Data.Position.PreparePosition, message);
         var maxTimestamp = _buffer.Max(v => v.Value.Data.Timestamp);
         ProcessAllFor(maxTimestamp);
     }
 }
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:13,代码来源:EventReorderingReaderSubscription.cs

示例15: Handle

        public bool Handle(ReaderSubscriptionMessage.CommittedEventDistributed message)
        {
            EnsureStarted();
            if (message.CorrelationId != _eventReaderId)
                return false;
            if (message.Data == null)
                return true;

            ValidateEventOrder(message);

            CacheRecentMessage(message);
            DistributeMessage(message);
            return true;
        }
开发者ID:czcz1024,项目名称:EventStore,代码行数:14,代码来源:HeadingEventReader.cs


注:本文中的ReaderSubscriptionMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。