示例#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);
     }
 }
示例#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());
            }
        }
示例#3
0
 public abstract void SendNotification(WorkerResult notifyItem);