Загрузка страницы

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
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
15 марта 2024 г. 11:26:52
00:18:42
Другие видео канала
TYPE IN YOUR NATIVE INDIAN LANGUAGE - Setting up Indic Keyboard on Your Android PhoneTYPE IN YOUR NATIVE INDIAN LANGUAGE - Setting up Indic Keyboard on Your Android PhoneCoding Mode on the BenQ Eye-care Monitor GW2785TCCoding Mode on the BenQ Eye-care Monitor GW2785TCASP NET CORE SINGLE PAGE APPLICATION (SPA) Build/Release Pipeline | Azure DevOpsASP NET CORE SINGLE PAGE APPLICATION (SPA) Build/Release Pipeline | Azure DevOpsDynamoDB QUERYING INDEX using HIGH-LEVEL API (DynamoDBContext) | .NET ON AWS | Serverless | AmazonDynamoDB QUERYING INDEX using HIGH-LEVEL API (DynamoDBContext) | .NET ON AWS | Serverless | AmazonMESSAGE DISPATCHING MODES RabbitMQ from DOTNET | Amazon MQMESSAGE DISPATCHING MODES RabbitMQ from DOTNET | Amazon MQCmder - Portable Console Emulator for WindowsCmder - Portable Console Emulator for WindowsSETUP AWS FREE Tier Account and .NET Development Environment | FREE FIRST MODULE of my Udemy CourseSETUP 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 DOTNETAre You Using Cancellation Token The Right Way? 5 Recommended Patterns | Exploring C# and DOTNETConstructors and Enforcing InvariantsConstructors and Enforcing Invariants5 Ways To Query Amazon DynamoDB using .NET | AWS DynamoDB QUERYING | .NET ON AWS | AWS Serverless5 Ways To Query Amazon DynamoDB using .NET | AWS DynamoDB QUERYING | .NET ON AWS | AWS ServerlessREFACTORING to MEDIATOR & CQS Pattern | AWS Lambda | ASP NET CoreREFACTORING to MEDIATOR & CQS Pattern | AWS Lambda | ASP NET CoreText Editing - Extract DataText Editing - Extract DataDynamoDB Update vs. Put | .NET ON AWS | AWS Serverless | AmazonDynamoDB Update vs. Put | .NET ON AWS | AWS Serverless | AmazonHEADERS EXCHANGE in RabbitMQ | RabbitMQ from DOTNET | Amazon MQHEADERS EXCHANGE in RabbitMQ | RabbitMQ from DOTNET | Amazon MQAWS PARAMETER STORE - Getting Started and Integrating with .NET Apps | .NET ON AWSAWS PARAMETER STORE - Getting Started and Integrating with .NET Apps | .NET ON AWSTRACING - Powertools for AWS Lambda | .NET ON AWS | Serverless | AmazonTRACING - Powertools for AWS Lambda | .NET ON AWS | Serverless | AmazonDynamoDB Local Secondary Index LSI | .NET ON AWS | AWS Serverless | AmazonDynamoDB Local Secondary Index LSI | .NET ON AWS | AWS Serverless | AmazonDynamoDB STREAMS & Lambda Triggers |  .NET ON AWS | AWS Serverless | AmazonDynamoDB STREAMS & Lambda Triggers | .NET ON AWS | AWS Serverless | AmazonHow To Apply Open Closed Principle To Event Driven Architecture |  Messaging Series .NETHow To Apply Open Closed Principle To Event Driven Architecture | Messaging Series .NETDynamoDB PROJECTION EXPRESSIONS | .NET ON AWS | AWS Serverless | AmazonDynamoDB PROJECTION EXPRESSIONS | .NET ON AWS | AWS Serverless | AmazonNServiceBus - Publish/Subscribe AWS SQS Transport Getting Started | .NET ON AWSNServiceBus - Publish/Subscribe AWS SQS Transport Getting Started | .NET ON AWS
Яндекс.Метрика