Example #1
0
 internal static async Task Run(IBackgourndTask task)
 {
     using (var runner = new TaskExecution(task))
     {
         await runner.DoRun();
     }
 }
Example #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());
         }
     }));
 }
Example #3
0
 internal static Task RunAll(IEnumerable <IBackgourndTask> tasks) =>
 Task.WhenAll(tasks.Select(t => TaskExecution.Run(t)));