Ejemplo n.º 1
0
        public Task <IEnumerable <StreamSubscription> > GetSubscriptions(IStreamIdentity streamIdentity)
        {
            var streamProviderName = this.name;
            var streamId           = StreamId.GetStreamId(streamIdentity.Guid, streamProviderName, streamIdentity.Namespace);

            return(streamPubSub.GetAllSubscriptions(streamId).ContinueWith(subs => subs.Result.AsEnumerable()));
        }
Ejemplo n.º 2
0
        public async Task <List <StreamSubscription> > GetAllSubscriptions(InternalStreamId streamId, IStreamConsumerExtension streamConsumer)
        {
            if (streamConsumer != null)
            {
                return(implicitPubSub.IsImplicitSubscriber(streamConsumer, streamId)
                    ? await implicitPubSub.GetAllSubscriptions(streamId, streamConsumer)
                    : await explicitPubSub.GetAllSubscriptions(streamId, streamConsumer));
            }
            else
            {
                var implicitSubs = await implicitPubSub.GetAllSubscriptions(streamId);

                var explicitSubs = await explicitPubSub.GetAllSubscriptions(streamId);

                return(implicitSubs.Concat(explicitSubs).ToList());
            }
        }
Ejemplo n.º 3
0
        public async Task <IList <StreamSubscriptionHandle <T> > > GetAllSubscriptions()
        {
            await BindExtensionLazy();

            List <GuidId> subscriptionIds = await pubSub.GetAllSubscriptions(stream.StreamId, myGrainReference);

            return(subscriptionIds.Select(id => new StreamSubscriptionHandleImpl <T>(id, stream))
                   .ToList <StreamSubscriptionHandle <T> >());
        }
Ejemplo n.º 4
0
        public async Task <IList <StreamSubscriptionHandle <T> > > GetAllSubscriptions()
        {
            await BindExtensionLazy();

            List <StreamSubscription> subscriptions = await pubSub.GetAllSubscriptions(stream.InternalStreamId, myGrainReference);

            return(subscriptions.Select(sub => new StreamSubscriptionHandleImpl <T>(GuidId.GetGuidId(sub.SubscriptionId), stream))
                   .ToList <StreamSubscriptionHandle <T> >());
        }
Ejemplo n.º 5
0
        public Task <IEnumerable <StreamSubscription> > GetSubscriptions(string streamProviderName, StreamId streamId)
        {
            var internalStreamId = new InternalStreamId(streamProviderName, streamId);

            return(streamPubSub.GetAllSubscriptions(internalStreamId).ContinueWith(subs => subs.Result.AsEnumerable()));
        }
Ejemplo n.º 6
0
 Task <List <GuidId> > IStreamPubSub.GetAllSubscriptions(StreamId streamId, IStreamConsumerExtension streamConsumer)
 {
     return(registry.GetAllSubscriptions(streamId, streamConsumer));
 }
Ejemplo n.º 7
0
 public async Task <List <GuidId> > GetAllSubscriptions(StreamId streamId, IStreamConsumerExtension streamConsumer)
 {
     return(IsImplicitSubscriber(streamConsumer, streamId)
         ? new List <GuidId>(new [] { GuidId.GetGuidId(streamConsumer.GetPrimaryKey()) })
         : await explicitPubSub.GetAllSubscriptions(streamId, streamConsumer));
 }
Ejemplo n.º 8
0
 public async Task <List <GuidId> > GetAllSubscriptions(StreamId streamId, IStreamConsumerExtension streamConsumer)
 {
     return(implicitPubSub.IsImplicitSubscriber(streamConsumer, streamId)
         ? await implicitPubSub.GetAllSubscriptions(streamId, streamConsumer)
         : await explicitPubSub.GetAllSubscriptions(streamId, streamConsumer));
 }