// observer-based notification public void Subscribe(int i, IClusterTestListener listener) { var grainRef = this.GrainFactory.GetGrain <IClusterTestGrain>(i); this.Client.Logger.Info("Create Listener object {0}", grainRef); listeners.Add(listener); var obj = this.GrainFactory.CreateObjectReference <IClusterTestListener>(listener).Result; listeners.Add(obj); this.Client.Logger.Info("Subscribe {0}", grainRef); Task toWait = grainRef.Subscribe(obj); toWait.GetResult(); }
public Task Subscribe(IClusterTestListener listener) { observers.Add(listener); logger.Info("AddedSubscription {0}", observers.Count); return TaskDone.Done; }
public Task Subscribe(IClusterTestListener listener) { observers.Add(listener); logger.Info("AddedSubscription {0}", observers.Count); return(Task.CompletedTask); }