本文整理汇总了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);
}
示例2: IsMessageAfterCheckpointTag
public override bool IsMessageAfterCheckpointTag(
CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
{
if (previous.Phase < Phase)
return true;
return committedEvent.Data.Position.PreparePosition > previous.PreparePosition;
}
示例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;
}
示例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];
}
示例5: Handle
public bool Handle(ReaderSubscriptionMessage.EventReaderIdle message)
{
EnsureStarted();
if (message.CorrelationId != _eventReaderId)
return false;
DistributeMessage(message);
return true;
}
示例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);
}
示例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);
}
示例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];
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}