C# Advanced Async – Getting progress reports, cancelling tasks, and more



Now that we know how to do the basics in async, let us take it to the next level. In this video, we look at how to get status reports back from asynchronous tasks so we can display a progress bar and more to the screen while they are running. We also set up the ability to cancel a long-running or hung asynchronous task.

We will also explore the differences between adding tasks in a foreach loop vs Parallel.foreach and how we can even get the benefits of both methods at the same time.

– Newsletter signup (with exclusive discounts): https://signup.iamtimcorey.com/ (your email will be kept safe and you will not be spammed).
– Source Code: https://leadmagnets.app/?Resource=AdvancedAsyncDemo
– Intro to Async / Await: https://youtu.be/2moh18sh5p4

0:00 – Intro
0:55 – Demo application walk-through
5:05 – Code behind demo application
12:00 – Implementing a progress report for tasks to be done
23:11 – Progress report recap
25:02 – Canceling tasks/methods; Cancellation tokens
33:58 – Canceling recap
35:34 – Parallel synchronous operation: Parallel.ForEach
41:38 – Parallel asynchronous operation
46:56 – Conclusions
50:26 – Summary

Comments are closed.