Cancellation Token in .NET | Exploring C# and DOTNET
Hey 👋 Imagine having a long-running request triggered by a user on your server. But, the user is no longer interested in the result and has navigated away from the page.
However, the server is still processing that request and utilizing resources until you come along and implement Cancellation Tokens in the application code.
.NET uses Cancellation Token for cooperative cancellation of asynchronous or long-running synchronous operations.
So let’s learn more about Cancellation Token and save some of that server compute time.
I will show you the problem of unnecessarily spending server resources on no longer required processes and how to solve them using Cancellation Tokens.
We will see an example of using Cancellation tokens in a console application, in a long-running HTTP API Endpoint, and when making external calls to API Endpoints. I will use Amazon S3 to show how you can use Cancellation Tokens to cancel from uploading large documents when they are no longer required.
Thank you to AWS for sponsoring this video.
🔗 Blog - https://www.rahulpnath.com/blog/cancellation-token-dotnet/
🔗 Code - https://github.com/rahulpnath/youtube-samples/tree/main/cancellation-token-example
00:00 Introduction
00:44 The Problem
03:22 What is Cancellation Token
04:48 Cancellation Token Demo
08:12 Passing Cancellation Tokens
10:09 Listening to Cancellation Requests
10:32 Cancellation Token In API
13:30 Cancellation Token and HTTP API Calls
13:54 AWS S3 Storage
18:05 Should you always Cancel?
Additional Watching
📹C# Series - https://bit.ly/mycsharp
📹 ASP Series - https://bit.ly/asp-net-core-series
📹Azure Series - https://bit.ly/azure-series
📹AWS Series - https://bit.ly/aws-net-series
📹RabbitMQ Series - https://bit.ly/rabbitmq-net-series
Come say hi! ✋
🎙️Uses - https://www.rahulpnath.com/uses
🌍Blog - https://www.rahulpnath.com/
✉ Subscribe to my Newsletter - https://www.rahulpnath.com/subscribe
🐦Twitter - https://twitter.com/rahulpnath
📸Instagram - https://www.instagram.com/rahulpnath/
#dotnet #csharp
Видео Cancellation Token in .NET | Exploring C# and DOTNET канала Rahul Nath
However, the server is still processing that request and utilizing resources until you come along and implement Cancellation Tokens in the application code.
.NET uses Cancellation Token for cooperative cancellation of asynchronous or long-running synchronous operations.
So let’s learn more about Cancellation Token and save some of that server compute time.
I will show you the problem of unnecessarily spending server resources on no longer required processes and how to solve them using Cancellation Tokens.
We will see an example of using Cancellation tokens in a console application, in a long-running HTTP API Endpoint, and when making external calls to API Endpoints. I will use Amazon S3 to show how you can use Cancellation Tokens to cancel from uploading large documents when they are no longer required.
Thank you to AWS for sponsoring this video.
🔗 Blog - https://www.rahulpnath.com/blog/cancellation-token-dotnet/
🔗 Code - https://github.com/rahulpnath/youtube-samples/tree/main/cancellation-token-example
00:00 Introduction
00:44 The Problem
03:22 What is Cancellation Token
04:48 Cancellation Token Demo
08:12 Passing Cancellation Tokens
10:09 Listening to Cancellation Requests
10:32 Cancellation Token In API
13:30 Cancellation Token and HTTP API Calls
13:54 AWS S3 Storage
18:05 Should you always Cancel?
Additional Watching
📹C# Series - https://bit.ly/mycsharp
📹 ASP Series - https://bit.ly/asp-net-core-series
📹Azure Series - https://bit.ly/azure-series
📹AWS Series - https://bit.ly/aws-net-series
📹RabbitMQ Series - https://bit.ly/rabbitmq-net-series
Come say hi! ✋
🎙️Uses - https://www.rahulpnath.com/uses
🌍Blog - https://www.rahulpnath.com/
✉ Subscribe to my Newsletter - https://www.rahulpnath.com/subscribe
🐦Twitter - https://twitter.com/rahulpnath
📸Instagram - https://www.instagram.com/rahulpnath/
#dotnet #csharp
Видео Cancellation Token in .NET | Exploring C# and DOTNET канала Rahul Nath
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
TYPE IN YOUR NATIVE INDIAN LANGUAGE - Setting up Indic Keyboard on Your Android PhoneCoding Mode on the BenQ Eye-care Monitor GW2785TCASP NET CORE SINGLE PAGE APPLICATION (SPA) Build/Release Pipeline | Azure DevOpsRecord Types - Value Based Equality | Learn C# #shortsDynamoDB QUERYING INDEX using HIGH-LEVEL API (DynamoDBContext) | .NET ON AWS | Serverless | AmazonMESSAGE DISPATCHING MODES RabbitMQ from DOTNET | Amazon MQCmder - Portable Console Emulator for WindowsSETUP AWS FREE Tier Account and .NET Development Environment | FREE FIRST MODULE of my Udemy CourseAre You Using Cancellation Token The Right Way? 5 Recommended Patterns | Exploring C# and DOTNETConstructors and Enforcing Invariants5 Ways To Query Amazon DynamoDB using .NET | AWS DynamoDB QUERYING | .NET ON AWS | AWS ServerlessThe DRY Principle | .NET Design PrinciplesREFACTORING to MEDIATOR & CQS Pattern | AWS Lambda | ASP NET CoreLaunchSettings.json in ASP NET CORE | Getting Started with ASP.NET Core SeriesText Editing - Extract DataDynamoDB Update vs. Put | .NET ON AWS | AWS Serverless | AmazonAbort Controller and Cancellation Tokens | Cancel Your Work All the Way | ASP NETHEADERS EXCHANGE in RabbitMQ | RabbitMQ from DOTNET | Amazon MQAWS PARAMETER STORE - Getting Started and Integrating with .NET Apps | .NET ON AWSTRACING - Powertools for AWS Lambda | .NET ON AWS | Serverless | AmazonDynamoDB Local Secondary Index LSI | .NET ON AWS | AWS Serverless | Amazon