Master C# Task Cancellation: A Deep Dive with C# CancellationToken and CancellationTokenSource
Tural Suleymani Tural Suleymani
4.52K subscribers
1,029 views
46

 Published On Jan 27, 2024

In this video, we explore the ins and outs of task cancellation using C# CancellationToken and C# CancellationTokenSource, with a real-world example of downloading files from an FTP server in a Windows Forms application.

🛑 Learn about different ways of cancellation, including:
1️⃣ Soft Failure: Understand how to gracefully handle cancellations without compromising your application's integrity.
2️⃣ Recommended Cancellation for Tasks: Discover best practices for canceling tasks in C# to enhance the overall performance of your application.
3️⃣ Task Cancellation Notification: Explore methods for notifying users and handling task cancellations effectively.
4️⃣ Composite CancellationToken: Master the art of combining cancellation tokens to create a powerful mechanism for managing multiple cancellation sources.

🔗 Timestamps:
0:00 - Introduction
00:56 - What we're going to build?
01:44 - Creating FTP download Task
05:22 - Integrating CancellationTokenSource (soft failure)
09:40 - Synchronization Context
13:25 - Recommended Cancellation
14:50 - Task Cancellation notification
15:49 - Composite Cancellation token

🔥 Whether you're a seasoned developer or a beginner, this video is packed with valuable insights and practical examples to level up your C# skills. Don't miss out – hit play now and supercharge your understanding of C# task cancellation! 💻🚀

show more

Share/Embed