本文整理汇总了C#中ReaderSubscriptionMessage类的典型用法代码示例。如果您正苦于以下问题:C# ReaderSubscriptionMessage类的具体用法?C# ReaderSubscriptionMessage怎么用?C# ReaderSubscriptionMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReaderSubscriptionMessage类属于命名空间,在下文中一共展示了ReaderSubscriptionMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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));
if (committedEvent.Data.PositionStreamId != _catalogStream)
throw new InvalidOperationException(
string.Format(
"Invalid catalog stream '{0}'. Expected catalog stream is '{1}'", committedEvent.Data.EventStreamId, _catalogStream));
return CheckpointTag.FromByStreamPosition(
previous.Phase, "", committedEvent.Data.PositionSequenceNumber, null,
-1, previous.CommitPosition.GetValueOrDefault());
}
开发者ID:nchistyakov,项目名称:EventStore-1,代码行数:16,代码来源:CatalogStreamPositionTagger.cs
示例17: 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.PositionStreamId != _stream)
throw new InvalidOperationException(
string.Format(
"Invalid stream '{0}'. Expected stream is '{1}'", partitionDeleted.Partition, _stream));
// return ordinary checkpoint tag (suitable for fromCategory.foreachStream as well as for regular fromStream
return CheckpointTag.FromStreamPosition(
previous.Phase, partitionDeleted.PositionStreamId, partitionDeleted.PositionEventNumber.Value);
}
开发者ID:czcz1024,项目名称:EventStore,代码行数:16,代码来源:StreamPositionTagger.cs
示例18: MakeCheckpointTag
public override CheckpointTag MakeCheckpointTag(
CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
{
if (committedEvent.Data.OriginalPosition < previous.Position)
throw new InvalidOperationException(
string.Format(
"Cannot make a checkpoint tag at earlier position. '{0}' < '{1}'",
committedEvent.Data.OriginalPosition, previous.Position));
var byIndex = _streams.Contains(committedEvent.Data.PositionStreamId);
return byIndex
? previous.UpdateEventTypeIndexPosition(
committedEvent.Data.OriginalPosition,
_streamToEventType[committedEvent.Data.PositionStreamId],
committedEvent.Data.PositionSequenceNumber)
: previous.UpdateEventTypeIndexPosition(committedEvent.Data.OriginalPosition);
}
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:16,代码来源:EventByTypeIndexPositionTagger.cs
示例19: 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.DeleteEventOrLinkTargetPosition < previous.Position)
throw new InvalidOperationException(
string.Format(
"Cannot make a checkpoint tag at earlier position. '{0}' < '{1}'",
partitionDeleted.DeleteEventOrLinkTargetPosition, previous.Position));
var byIndex = _streams.Contains(partitionDeleted.PositionStreamId);
//TODO: handle invalid partition deleted messages without required values
return byIndex
? previous.UpdateEventTypeIndexPosition(
partitionDeleted.DeleteEventOrLinkTargetPosition.Value, _streamToEventType[partitionDeleted.PositionStreamId],
partitionDeleted.PositionEventNumber.Value)
: previous.UpdateEventTypeIndexPosition(partitionDeleted.DeleteEventOrLinkTargetPosition.Value);
}
开发者ID:danieldeb,项目名称:EventStore,代码行数:20,代码来源:EventByTypeIndexPositionTagger.cs
示例20: 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));
if (committedEvent.Data.EventOrLinkTargetPosition < previous.Position)
throw new InvalidOperationException(
string.Format(
"Cannot make a checkpoint tag at earlier position. '{0}' < '{1}'",
committedEvent.Data.EventOrLinkTargetPosition, previous.Position));
var byIndex = _streams.Contains(committedEvent.Data.PositionStreamId);
return byIndex
? previous.UpdateEventTypeIndexPosition(
committedEvent.Data.EventOrLinkTargetPosition,
_streamToEventType[committedEvent.Data.PositionStreamId],
committedEvent.Data.PositionSequenceNumber)
: previous.UpdateEventTypeIndexPosition(committedEvent.Data.EventOrLinkTargetPosition);
}
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:20,代码来源:EventByTypeIndexPositionTagger.cs
注:本文中的ReaderSubscriptionMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论