Пример #1
0
        public Task <IEnumerable <StreamSubscription> > GetSubscriptions(FullStreamIdentity streamIdentity)
        {
            var subManager = this.ServiceProvider.GetService <IStreamSubscriptionManagerAdmin>().GetStreamSubscriptionManager(StreamSubscriptionManagerType.ExplicitSubscribeOnly);

            return(subManager.GetSubscriptions(streamIdentity.ProviderName, streamIdentity));
        }
Пример #2
0
 public async Task RemoveSubscription(FullStreamIdentity streamId, Guid subscriptionId)
 {
     var subManager = this.ServiceProvider.GetService <IStreamSubscriptionManagerAdmin>().GetStreamSubscriptionManager(StreamSubscriptionManagerType.ExplicitSubscribeOnly);
     await subManager.RemoveSubscription(streamId.ProviderName, streamId, subscriptionId);
 }
Пример #3
0
        public async Task <List <StreamSubscription> > SetupStreamingSubscriptionForStream <TGrainInterface>(FullStreamIdentity streamIdentity, int grainCount)
            where TGrainInterface : IGrainWithGuidKey
        {
            var subscriptions = new List <StreamSubscription>();

            while (grainCount > 0)
            {
                var grainId    = Guid.NewGuid();
                var grainRef   = this.GrainFactory.GetGrain <TGrainInterface>(grainId) as GrainReference;
                var subManager = this.ServiceProvider.GetService <IStreamSubscriptionManagerAdmin>().GetStreamSubscriptionManager(StreamSubscriptionManagerType.ExplicitSubscribeOnly);
                subscriptions.Add(await subManager.AddSubscription(streamIdentity.ProviderName, streamIdentity, grainRef));
                grainCount--;
            }
            return(subscriptions);
        }