private void SendMessage(string message) { var yakMsg = new YakMessage { gravatar = _gravatar, message = message, timestamp = Since(DateTime.UtcNow), name = _userName, key = Md5(_userName + "-" + DateTime.UtcNow) }; var riakObj = new RiakObject("messages", yakMsg.key, yakMsg); var result = _riakClient.Put(riakObj); if (!result.IsSuccess) { Console.Error.WriteLine("Failed to send message!"); } }
private void DisplayMessage(YakMessage msg) { var time = _timeStart.AddMilliseconds(msg.timestamp); Console.WriteLine("[{0:HH:mm:ss}] <{1}> {2}", time.ToLocalTime(), msg.name, msg.message); }