static async Task Subscribe() { var orleans = ManagementGrainFactory.GetGrain(0); var hosts = await orleans.GetHosts(true); foreach (var silo in hosts) { var address = silo.Key; var status = silo.Value; if (status != SiloStatus.Active) { continue; } var id = HubGateway.HubId(address.Endpoint); var hub = MvcApplication.System.ActorOf <Hub>(id); await hub.Tell(new Subscribe { Observer = observer }); } }
static async Task Subscribe() { var orleans = MvcApplication.System.Client.GetGrain <IManagementGrain>(0); var hosts = await orleans.GetHosts(true); foreach (var silo in hosts) { var address = silo.Key; var status = silo.Value; if (status != SiloStatus.Active) { continue; } var id = HubGateway.HubId(address.Endpoint); var path = ActorPath.From("Hub", id); var hub = MvcApplication.System.ActorOf(path); await hub.Tell(new SubscribeHub { Observer = notifications.Ref }); } }