Exemplo n.º 1
0
        public async Task<ResultMessage> WriteToFile(NotificationMessage message)
        {
            StreamWriter file = new StreamWriter(@"C:\Users\tarakci\Downloads\akkaLog\notifications.txt", true);
            file.WriteLine($"User ID: {message.UserId} - Message: {message.Notification}");
            file.Close();

            _logger.Info($"Notification has sent to -> {message.UserId}");

            _analyzer.CountNotifications();

            return await Task.FromResult(new ResultMessage()
            {
                Result = "done",
                CreateDate = DateTime.Now
            });
        }
Exemplo n.º 2
0
 public void HandleMessage(NotificationMessage message)
 {
     WriteToFile(message).PipeTo(Self, Sender);
 }
Exemplo n.º 3
0
 public void HandleNotification(NotificationMessage message)
 {
     _pushNotificationActor.Tell(message);
 }