Ejemplo n.º 1
0
 public virtual async Task Notify(WorkerResult notifyItem)
 {
     try
     {
         SendNotification(notifyItem);
     }
     catch (Exception ex)
     {
         Log.Error($"Notification of {this.Type.ToString()} from ThreadGroup '{this.ThreadGroup}' could not be sent.", exception: ex);
     }
 }
Ejemplo n.º 2
0
        protected virtual async Task SendNotifications(NotificationType type, WorkerResult result)
        {
            if (!_Notifications.NullOrEmpty())
            {
                List <Task> sender = new List <Task>();

                _Notifications.Where(n => n.Type == NotificationType.FAILURE).ToList().ForEach((notification) =>
                {
                    sender.Add(notification.Notify(result));
                });

                Task.WaitAll(sender.ToArray());
            }
        }
Ejemplo n.º 3
0
 public abstract void SendNotification(WorkerResult notifyItem);