当前位置: 首页>>代码示例>>C#>>正文


C# StreamId类代码示例

本文整理汇总了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;
        }
开发者ID:osjimenez,项目名称:orleans,代码行数:33,代码来源:ImplicitStreamSubscriberTable.cs

示例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;
 }
开发者ID:naeemkhedarun,项目名称:orleans,代码行数:7,代码来源:StreamPubSubImpl.cs

示例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;
 }
开发者ID:JackWangCUMT,项目名称:orleans,代码行数:7,代码来源:StreamConsumerCollection.cs

示例4: StreamConsumerData

 public StreamConsumerData(GuidId subscriptionId, StreamId streamId, IStreamConsumerExtension streamConsumer, IStreamFilterPredicateWrapper filter)
 {
     SubscriptionId = subscriptionId;
     StreamId = streamId;
     StreamConsumer = streamConsumer;
     Filter = filter;
 }
开发者ID:hanin,项目名称:orleans,代码行数:7,代码来源:QueueStreamDataStructures.cs

示例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()) });
 }
开发者ID:sbambach,项目名称:orleans,代码行数:8,代码来源:ImplicitStreamPubSub.cs

示例6: sceMpegGetAtracAu

		public int sceMpegGetAtracAu(SceMpegPointer* Mpeg, StreamId StreamId, SceMpegAu* MpegAccessUnit, void* Atrac3PlusPointer)
		{
			CheckEnabledMpeg();

			//Mpeg->SceMpegData.

			throw (new SceKernelException(SceKernelErrors.ERROR_MPEG_NO_DATA));
		}
开发者ID:shin527,项目名称:cspspemu,代码行数:8,代码来源:sceMpeg.Atrac.cs

示例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;
 }
开发者ID:soywiz,项目名称:cspspemu,代码行数:8,代码来源:sceMpeg.Atrac.cs

示例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;
 }
开发者ID:nehmebilal,项目名称:orleans,代码行数:8,代码来源:ImplicitStreamPubSub.cs

示例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);
 }
开发者ID:PaulNorth,项目名称:orleans,代码行数:10,代码来源:ImplicitStreamPubSub.cs

示例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);
        }
开发者ID:sbambach,项目名称:orleans,代码行数:10,代码来源:SimpleMessageStreamProducerExtension.cs

示例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);
        }
开发者ID:nehmebilal,项目名称:orleans,代码行数:13,代码来源:ImplicitStreamPubSub.cs

示例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;
		}
开发者ID:shin527,项目名称:cspspemu,代码行数:14,代码来源:sceMpeg.Avc.cs

示例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;
		}
开发者ID:shin527,项目名称:cspspemu,代码行数:18,代码来源:sceMpeg.Streams.cs

示例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;
        }
开发者ID:NaseUkolyCZ,项目名称:Orleankka,代码行数:17,代码来源:StreamPubSubWrapper.cs

示例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.
     }
 }
开发者ID:sbambach,项目名称:orleans,代码行数:18,代码来源:SimpleMessageStreamProducerExtension.cs


注:本文中的StreamId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。