Ejemplo n.º 1
0
 internal void SetFaultHandler(TaskBase handler)
 {
     Task.ContinueWith(t => handler.Start(t), Token,
                       TaskContinuationOptions.OnlyOnFaulted,
                       TaskManager.GetScheduler(handler.Affinity));
     DependsOn?.SetFaultHandler(handler);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// This does not set a dependency between the two tasks. Instead,
 /// the Start method grabs the state of the previous task to pass on
 /// to the next task via previousSuccess and previousException
 /// </summary>
 /// <param name="handler"></param>
 internal void SetFaultHandler(TaskBase handler)
 {
     Task.ContinueWith(t =>
     {
         Token.ThrowIfCancellationRequested();
         handler.Start(t);
     },
                       Token,
                       TaskContinuationOptions.OnlyOnFaulted,
                       TaskManager.GetScheduler(handler.Affinity));
     DependsOn?.SetFaultHandler(handler);
 }