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); } }
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()); } }
public abstract void SendNotification(WorkerResult notifyItem);