本文整理汇总了C#中NetMQMessage.PopInt64方法的典型用法代码示例。如果您正苦于以下问题:C# NetMQMessage.PopInt64方法的具体用法?C# NetMQMessage.PopInt64怎么用?C# NetMQMessage.PopInt64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetMQMessage
的用法示例。
在下文中一共展示了NetMQMessage.PopInt64方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getCommit
private CommitForStorage getCommit(NetMQMessage message)
{
var context = message.Pop().ConvertToString();
var stream = message.Pop().ConvertToString();
var expectedVersion = message.PopInt64();
var eventCount = message.PopInt32();
var events = new EventForStorage[eventCount];
for (int i = 0; i < eventCount; i++)
{
var eventId = new Guid(message.Pop().ToByteArray());
var timestamp = message.PopDateTime();
var typeKey = message.PopString();
var headers = message.PopStringOrNull();
var body = message.PopString();
//-1 to override concurrency check. Being lazy and not using a constant.
var version = expectedVersion == -1 ? -1 : expectedVersion + i;
events[i] = new EventForStorage(eventId, version, timestamp, typeKey, headers, body);
}
return new CommitForStorage(context, stream, events);
}
示例2: Handle
public void Handle(NetMQFrame[] sender, NetMQMessage message)
{
Logger.Debug("[Query_LoadEventsByStream] Received a request.");
var requestId = message.Pop();
var context = message.Pop().ConvertToString();
var stream = message.Pop().ConvertToString();
var fromVersion = message.PopInt64();
var maxVersion = message.PopNullableInt64();
var events = _storage.LoadEventsForStream(context, stream, fromVersion, maxVersion);
var msg = new NetMQMessage();
msg.Append(sender);
msg.AppendEmptyFrame();
msg.Append(ResProtocol.ResClient01);
msg.Append(requestId);
msg.Append(ResCommands.QueryEventsByStreamResponse);
var count = events.Length;
msg.Append(count.ToNetMqFrame());
foreach (var e in events)
{
msg.Append(e.EventId.ToByteArray());
msg.Append(e.Stream);
msg.Append(e.Context);
msg.Append(e.Sequence.ToNetMqFrame());
msg.Append(e.Timestamp.ToNetMqFrame());
msg.Append(e.TypeKey);
msg.Append(e.Headers.ToNetMqFrame());
msg.Append(e.Body);
}
var result = new QueryEventsForStreamLoaded(msg);
while (!_buffer.Offer(result))
_spin.SpinOnce();
}