How to select various Task Continuation strategies in TPL
Consider the following continuation:
Task.Factory.StartNew(()=>
{
MethodA();
})
.ContinueWith((t)=>
{
MethodB();
})
.ContinueWith((t)=>
{
MethodC();
});
As I know the execution will be like this:
MethodA executes.
MethodB executes after MethodA completes.
MethodC executes after MethodB completes.
What if I wanted the MethodC to continue after MethodA completes.(instead
of waiting for MethodB)
I'm looking for a solution other than manually declaring the task
variables, instead I want to use the method sequencing by the fluent
factory.
No comments:
Post a Comment