예제 #1
0
        public async Task <Message> SendMsg(string msg, IChatRoomGrain chatRoomGrain)
        {
            var newMsg = new Message
            {
                Id             = Guid.NewGuid(),
                Content        = msg,
                SenderId       = State.Id,
                SenderNickname = State.Nickname
            };

            return(await chatRoomGrain.AddMessage(newMsg));
        }
예제 #2
0
        private static void SubscribeToMessageNotifications(IClusterClient client, ChatRoom chatRoom, IChatRoomGrain chatRoomGrain)
        {
            var msgHub    = new MessageHub(chatRoom);
            var msgHubObj = client.CreateObjectReference <IMessageHub>(msgHub).Result;

            chatRoomGrain.Subscribe(msgHubObj);
        }