There's a lot of confusion about async/await, Task/TPL, and asynchronous and parallel programming in general. So let's start with the basics and look at how we can consume asynchronous methods using Task and then see how the "await" operator can makes things easier for us. Along the way, we’ll look at continuations, cancellation, and exception handling.
Code samples and slides are included in this repository.
Articles and additional resources: http://www.jeremybytes.com/Demos.aspx#TaskAndAwait
Recorded Presentations
- NDC London - Jan 2016
- Central California .NET - Apr 2016 (extended version)
Articles
- Task and Await: Consuming Awaitable Methods
- UI Considerations When Using Asynchronous Methods
- Task and Await: Basic Exception Handling
- Task Continuations: Checking IsFaulted, IsCompleted, and Task.Status
- Task.IsCompletedSuccessfully - YAY! (and hmmm)
- Task and Await: Basic Cancellation
- Brownfield Async: Converting IAsyncResult to Task
- Book Review: Parallel Programming with Microsoft .NET
- Book Review: Async in C# 5.0
Video Series
- Playlist: Task and Await in C#
- Part 1: Consuming Asynchronous Methods
- Part 2: Basic Exception Handling
- Part 3: IsFaulted, IsCompleted, and Task.Status
- Part 4: Basic Cancellation
Progress Reporting
- Simple Progress Reporting with Task
- Custom Progress Reporting with Task
- When Progress Reporting Goes Bad: Incremental Progress vs. Cumulative Progress
- Pay Attention to Where You Create Progress Objects
Related Topics
- Learn to Love Lambdas (and LINQ, Too!)
- Get Func-y: Delegates in C#
- T, Earl Grey, Hot: Generics in C#
Experts
Parallel Programming wtih Task