本文整理汇总了C#中GuidId类的典型用法代码示例。如果您正苦于以下问题:C# GuidId类的具体用法?C# GuidId怎么用?C# GuidId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuidId类属于命名空间,在下文中一共展示了GuidId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddConsumer
public StreamConsumerData AddConsumer(GuidId subscriptionId, StreamId streamId, IStreamConsumerExtension streamConsumer, IStreamFilterPredicateWrapper filter)
{
var consumerData = new StreamConsumerData(subscriptionId, streamId, streamConsumer, filter);
queueData.Add(subscriptionId, consumerData);
lastActivityTime = DateTime.UtcNow;
return consumerData;
}
示例2: DeliverBatch
public async Task<StreamHandshakeToken> DeliverBatch(GuidId subscriptionId, Immutable<IBatchContainer> batch, StreamHandshakeToken handshakeToken)
{
foreach (var each in batch.Value.GetEvents<object>())
await handler(each.Item1);
return null;
}
示例3: StreamConsumerData
public StreamConsumerData(GuidId subscriptionId, StreamId streamId, IStreamConsumerExtension streamConsumer, IStreamFilterPredicateWrapper filter)
{
SubscriptionId = subscriptionId;
StreamId = streamId;
StreamConsumer = streamConsumer;
Filter = filter;
}
示例4: RegisterConsumer
public Task RegisterConsumer(GuidId subscriptionId, StreamId streamId, string streamProvider, IStreamConsumerExtension streamConsumer, IStreamFilterPredicateWrapper filter)
{
if (!IsImplicitSubscriber(streamConsumer, streamId))
{
throw new ArgumentOutOfRangeException(streamId.ToString(), "Only implicit subscriptions are supported.");
}
return TaskDone.Done;
}
示例5: RemoveConsumer
public bool RemoveConsumer(GuidId subscriptionId, Logger logger)
{
StreamConsumerData consumer;
if (!queueData.TryGetValue(subscriptionId, out consumer)) return false;
consumer.SafeDisposeCursor(logger);
return queueData.Remove(subscriptionId);
}
示例6: RemoveConsumer
public bool RemoveConsumer(GuidId subscriptionId)
{
StreamConsumerData consumer;
if (!queueData.TryGetValue(subscriptionId, out consumer)) return false;
if (consumer.Cursor != null)
{
// kill cursor activity and ensure it does not start again on this consumer data.
consumer.Cursor.Dispose();
consumer.Cursor = null;
}
return queueData.Remove(subscriptionId);
}
示例7: IsImplicitSubscriber
internal bool IsImplicitSubscriber(GuidId subscriptionId, StreamId streamId)
{
return SubscriptionMarker.IsImplicitSubscription(subscriptionId.Guid);
}
示例8: RemoveSubscriber_Impl
public void RemoveSubscriber_Impl(GuidId subscriptionId, StreamId streamId)
{
if (IsShutdown) return;
StreamConsumerCollection streamData;
if (!pubSubCache.TryGetValue(streamId, out streamData)) return;
// remove consumer
bool removed = streamData.RemoveConsumer(subscriptionId, logger);
if (removed && logger.IsVerbose) logger.Verbose((int)ErrorCode.PersistentStreamPullingAgent_10, "Removed Consumer: subscription={0}, for stream {1}.", subscriptionId, streamId);
if (streamData.Count == 0)
pubSubCache.Remove(streamId);
}
示例9: AddSubscriber_Impl
// Called by rendezvous when new remote subscriber subscribes to this stream.
private async Task AddSubscriber_Impl(
GuidId subscriptionId,
StreamId streamId,
IStreamConsumerExtension streamConsumer,
StreamSequenceToken cacheToken,
IStreamFilterPredicateWrapper filter)
{
if (IsShutdown) return;
StreamConsumerCollection streamDataCollection;
if (!pubSubCache.TryGetValue(streamId, out streamDataCollection))
{
streamDataCollection = new StreamConsumerCollection(DateTime.UtcNow);
pubSubCache.Add(streamId, streamDataCollection);
}
StreamConsumerData data;
if (!streamDataCollection.TryGetConsumer(subscriptionId, out data))
data = streamDataCollection.AddConsumer(subscriptionId, streamId, streamConsumer, filter ?? DefaultStreamFilter);
if (await DoHandshakeWithConsumer(data, cacheToken))
{
if (data.State == StreamConsumerDataState.Inactive)
RunConsumerCursor(data, data.Filter).Ignore(); // Start delivering events if not actively doing so
}
}
示例10: TryGetConsumer
public bool TryGetConsumer(GuidId subscriptionId, out StreamConsumerData data)
{
return queueData.TryGetValue(subscriptionId, out data);
}
示例11: OnSubscriptionFailure
public Task OnSubscriptionFailure(GuidId subscriptionId, string streamProviderName, IStreamIdentity streamIdentity,
StreamSequenceToken sequenceToken)
{
return TaskDone.Done;
}
示例12:
Task IStreamPubSub.UnregisterConsumer(GuidId subscriptionId, StreamId streamId, string streamProvider)
{
return registry.UnregisterConsumer(subscriptionId, streamId, streamProvider);
}
示例13: RemoveRemoteSubscriber
internal void RemoveRemoteSubscriber(GuidId subscriptionId)
{
Tuple<IStreamConsumerExtension, IStreamFilterPredicateWrapper> ignore;
consumers.TryRemove(subscriptionId, out ignore);
if (consumers.Count == 0)
{
// Unsubscribe from PubSub?
}
}
示例14: AddRemoteSubscriber
internal void AddRemoteSubscriber(GuidId subscriptionId, IStreamConsumerExtension streamConsumer, IStreamFilterPredicateWrapper filter)
{
consumers.TryAdd(subscriptionId, Tuple.Create(streamConsumer, filter));
}
示例15: Contains
public bool Contains(GuidId subscriptionId)
{
return queueData.ContainsKey(subscriptionId);
}