Continuation tokens let us continue the work started by one task. Learn how to pass state between tasks.
- [Instructor] Now that we've looked into cancellations,…if you remember, in the previous course,…not the pervious module, you actually had…done something called task continuations,…where we had an antecedent…and then we were able to get the result…from the antecedent in the continuation task.…Now this is continuation,…except this time we are going…to pass state with continuation.…And every single continuation task…could actually have a state.…
So we'll start with a very simple function,…more like a public static function…that returns anything, it could return anything whatsoever.…For now we'll just make it simple…and say return the date time,…and then simply say date time dot now.…So we need a task to run this…and we need the return type of date time.…And we'll say task equals task dot run.…
And we don't need to specify the type here,…'cause it automatically knows that…it is going to be date time,…'cause that's what we're expecting on the other side.…We complete the action, which is a lambda right here.…Next we want to create a list of continuation tasks.…
Released
4/2/2018- Thread safety and affinity
- Signaling
- Task Parallel Library (TPL) basics
- PLINQ introduction
- Task-based Asynchronous Pattern (TAP)
Share this video
Embed this video
Video: Continuation with state