internal void SetFaultHandler(TaskBase handler) { Task.ContinueWith(t => handler.Start(t), Token, TaskContinuationOptions.OnlyOnFaulted, TaskManager.GetScheduler(handler.Affinity)); DependsOn?.SetFaultHandler(handler); }
/// <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); }