public override bool ShutDown() { m_MainEntry.GetIGateWay().Result.UnSubscribeAsync(m_IGateWay_Obs).Wait(); m_ClusterClient.DeleteObjectReference <IGateWay_Obs>(m_IGateWay_Obs); StopSilo(); return(base.ShutDown()); }
public async Task BroadCast(IMessage msg) { IMainEntry ime = GrainFactory.GetGrain <IMainEntry>(0); var igw = await ime.GetIGateWay(); foreach (var vk in Dict_ChatUser) { await igw.Reply(await vk.Value.GetSessionId(), msg); } }
public override bool Init() { m_ClusterClient = InitialiseClient(); m_MainEntry = m_ClusterClient.GetGrain <IMainEntry>(0); m_SiloGateWay_Obs = new SiloGateWay_Obs(); m_IGateWay_Obs = m_ClusterClient.CreateObjectReference <IGateWay_Obs>(m_SiloGateWay_Obs).Result; m_IGateWay = m_MainEntry.GetIGateWay().Result; m_IGateWay.SubscribeAsync(m_IGateWay_Obs).Wait(); m_ChatRoom = m_MainEntry.GetIChatRoom().Result; return(base.Init()); }