本文整理汇总了C#中StreamId类的典型用法代码示例。如果您正苦于以下问题:C# StreamId类的具体用法?C# StreamId怎么用?C# StreamId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StreamId类属于命名空间,在下文中一共展示了StreamId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetImplicitSubscribers
/// <summary>
/// Retrieve a map of implicit subscriptionsIds to implicit subscribers, given a stream ID. This method throws an exception if there's no namespace associated with the stream ID.
/// </summary>
/// <param name="streamId">A stream ID.</param>
/// <returns>A set of references to implicitly subscribed grains. They are expected to support the streaming consumer extension.</returns>
/// <exception cref="System.ArgumentException">The stream ID doesn't have an associated namespace.</exception>
/// <exception cref="System.InvalidOperationException">Internal invariant violation.</exception>
internal IDictionary<Guid, IStreamConsumerExtension> GetImplicitSubscribers(StreamId streamId)
{
if (String.IsNullOrWhiteSpace(streamId.Namespace))
{
throw new ArgumentException("The stream ID doesn't have an associated namespace.", "streamId");
}
HashSet<int> entry;
var result = new Dictionary<Guid, IStreamConsumerExtension>();
if (table.TryGetValue(streamId.Namespace, out entry))
{
foreach (var i in entry)
{
IStreamConsumerExtension consumer = MakeConsumerReference(streamId.Guid, i);
Guid subscriptionGuid = MakeSubscriptionGuid(i, streamId);
if (result.ContainsKey(subscriptionGuid))
{
throw new InvalidOperationException(string.Format("Internal invariant violation: generated duplicate subscriber reference: {0}, subscriptionId: {1}", consumer, subscriptionGuid));
}
result.Add(subscriptionGuid, consumer);
}
return result;
}
return result;
}
示例2: RegisterProducer
public async Task<ISet<PubSubSubscriptionState>> RegisterProducer(StreamId streamId, string streamProvider, IStreamProducerExtension streamProducer)
{
ISet<PubSubSubscriptionState> explicitRes = await explicitPubSub.RegisterProducer(streamId, streamProvider, streamProducer);
ISet<PubSubSubscriptionState> implicitRes = await implicitPubSub.RegisterProducer(streamId, streamProvider, streamProducer);
explicitRes.UnionWith(implicitRes);
return explicitRes;
}
示例3: 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;
}
示例4: StreamConsumerData
public StreamConsumerData(GuidId subscriptionId, StreamId streamId, IStreamConsumerExtension streamConsumer, IStreamFilterPredicateWrapper filter)
{
SubscriptionId = subscriptionId;
StreamId = streamId;
StreamConsumer = streamConsumer;
Filter = filter;
}
示例5: GetAllSubscriptions
public Task<List<GuidId>> GetAllSubscriptions(StreamId streamId, IStreamConsumerExtension streamConsumer)
{
if (!IsImplicitSubscriber(streamConsumer, streamId))
{
throw new ArgumentOutOfRangeException(streamId.ToString(), "Only implicit subscriptions are supported.");
}
return Task.FromResult(new List<GuidId> { GuidId.GetGuidId(streamConsumer.GetPrimaryKey()) });
}
示例6: sceMpegGetAtracAu
public int sceMpegGetAtracAu(SceMpegPointer* Mpeg, StreamId StreamId, SceMpegAu* MpegAccessUnit, void* Atrac3PlusPointer)
{
CheckEnabledMpeg();
//Mpeg->SceMpegData.
throw (new SceKernelException(SceKernelErrors.ERROR_MPEG_NO_DATA));
}
示例7: sceMpegGetAtracAu
public int sceMpegGetAtracAu(SceMpegPointer* SceMpegPointer, StreamId StreamId, out SceMpegAu MpegAccessUnit, out PspPointer Atrac3PlusPointer)
{
var Mpeg = GetMpeg(SceMpegPointer);
if (!Mpeg.HasData) throw (new SceKernelException(SceKernelErrors.ERROR_MPEG_NO_DATA));
MpegAccessUnit = Mpeg.GetAtracAu(StreamId);
Atrac3PlusPointer.Address = 0;
return 0;
}
示例8: 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;
}
示例9: CreateSubscriptionId
public GuidId CreateSubscriptionId(StreamId streamId, IStreamConsumerExtension streamConsumer)
{
GrainId grainId = GrainExtensions.GetGrainId(streamConsumer);
Guid subscriptionGuid;
if (!implicitTable.TryGetImplicitSubscriptionGuid(grainId, streamId, out subscriptionGuid))
{
throw new ArgumentOutOfRangeException(streamId.ToString(), "Only implicit subscriptions are supported.");
}
return GuidId.GetGuidId(subscriptionGuid);
}
示例10: AddStream
internal void AddStream(StreamId streamId)
{
StreamConsumerExtensionCollection obs;
// no need to lock on _remoteConsumers, since on the client we have one extension per stream (per StreamProducer)
// so this call is only made once, when StreamProducer is created.
if (remoteConsumers.TryGetValue(streamId, out obs)) return;
obs = new StreamConsumerExtensionCollection();
remoteConsumers.Add(streamId, obs);
}
示例11: RegisterProducer
public Task<ISet<PubSubSubscriptionState>> RegisterProducer(StreamId streamId, string streamProvider, IStreamProducerExtension streamProducer)
{
ISet<PubSubSubscriptionState> result = new HashSet<PubSubSubscriptionState>();
if (String.IsNullOrWhiteSpace(streamId.Namespace)) return Task.FromResult(result);
IDictionary<Guid, IStreamConsumerExtension> implicitSubscriptions = implicitTable.GetImplicitSubscribers(streamId);
foreach (var kvp in implicitSubscriptions)
{
GuidId subscriptionId = GuidId.GetGuidId(kvp.Key);
result.Add(new PubSubSubscriptionState(subscriptionId, streamId, kvp.Value));
}
return Task.FromResult(result);
}
示例12: sceMpegGetAvcAu
public int sceMpegGetAvcAu(SceMpegPointer* Mpeg, StreamId StreamId, SceMpegAu* MpegAccessUnit, int* DataAttributes)
{
CheckEnabledMpeg();
if (DataAttributes != null)
{
*DataAttributes = 1;
}
throw(new SceKernelException(SceKernelErrors.ERROR_MPEG_NO_DATA));
//throw(new NotImplementedException());
//return 0;
}
示例13: sceMpegRegistStream
//public SceMpegStream* sceMpegRegistStream(SceMpeg* Mpeg, int iStreamID, int iUnk)
public int sceMpegRegistStream(SceMpegPointer* Mpeg, StreamId StreamId, int StreamIndex)
{
CheckEnabledMpeg();
var StreamInfoId = RegisteredStreams.Create(new StreamInfo()
{
StreamId = StreamId,
StreamIndex = StreamIndex,
});
//Console.WriteLine(iStreamID);
//return 0;
//var SceMpegData = GetSceMpegData(Mpeg);
//throw(new NotImplementedException());
return StreamInfoId;
}
示例14: matcher
async Task<ISet<PubSubSubscriptionState>> IStreamPubSub.RegisterProducer(StreamId streamId, string streamProvider, IStreamProducerExtension streamProducer)
{
var matches = new PubSubSubscriptionState[0];
if (ShouldMatch(streamProvider))
{
matches = (from StreamPubSubMatch m in matcher(new StreamIdentity(streamId))
let subId = GuidId.GetNewGuidId()
select new PubSubSubscriptionState(subId, streamId, new PushExtension(m), null))
.ToArray();
}
var registered = await registry.RegisterProducer(streamId, streamProvider, streamProducer);
registered.UnionWith(matches);
return registered;
}
示例15: AddSubscribers
internal void AddSubscribers(StreamId streamId, ICollection<PubSubSubscriptionState> newSubscribers)
{
if (logger.IsVerbose) logger.Verbose("{0} AddSubscribers {1} for stream {2}", providerRuntime.ExecutingEntityIdentity(), Utils.EnumerableToString(newSubscribers), streamId);
StreamConsumerExtensionCollection consumers;
if (remoteConsumers.TryGetValue(streamId, out consumers))
{
foreach (var newSubscriber in newSubscribers)
{
consumers.AddRemoteSubscriber(newSubscriber.SubscriptionId, newSubscriber.Consumer, newSubscriber.Filter);
}
}
else
{
// We got an item when we don't think we're the subscriber. This is a normal race condition.
// We can drop the item on the floor, or pass it to the rendezvous, or log a warning.
}
}