internal static async Task Run(IBackgourndTask task)
 {
     using (var runner = new TaskExecution(task))
     {
         await runner.DoRun();
     }
 }
Exemple #2
0
 internal static async Task RunAll(IEnumerable <IBackgourndTask> tasks)
 {
     await Task.WhenAll(tasks.Select(async t =>
     {
         try
         {
             await TaskExecution.Run(t);
         }
         catch (Exception ex)
         {
             Log.For <ExecutionEngine>().Error(ex, $"Failed to run background task : {t.Name} because : " + ex.ToFullMessage());
         }
     }));
 }
 internal static Task RunAll(IEnumerable <IBackgourndTask> tasks) =>
 Task.WhenAll(tasks.Select(t => TaskExecution.Run(t)));