Ejemplo n.º 1
0
        public async Task Unsubscribe(IMessageObserver observer)
        {
            this.observers.Unsubscribe(observer);
            if (this.observers.Count == 0)
            {
                var manager = PubSubManagerFactory.GetGrain(0);
                await manager.Unregister(this);

                this.DeactivateOnIdle(); // remove this grain
            }
        }
Ejemplo n.º 2
0
        public async override Task ActivateAsync()
        {
            this.observers   = new ObserverSubscriptionManager <IMessageObserver>();
            this.otherGrains = new IPubSubGrain[] { };

            var manager = PubSubManagerFactory.GetGrain(0);

            this.otherGrains = await manager.Register(this);

            await base.ActivateAsync();
        }
Ejemplo n.º 3
0
        public override Task DeactivateAsync()
        {
            var manager = PubSubManagerFactory.GetGrain(0);

            return(manager.Unregister(this));
        }