Тёмный
No video :(

Are You Using Cancellation Token The Right Way? 5 Recommended Patterns | Exploring C# and DOTNET 

Rahul Nath
Подписаться 32 тыс.
Просмотров 1,8 тыс.
50% 1

Опубликовано:

 

22 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@zdxzxzdxzx6780
@zdxzxzdxzx6780 4 месяца назад
Very, very important topic. Thanks Rahul!
@RahulNath
@RahulNath 4 месяца назад
Glad you liked it!
@brycewoods9007
@brycewoods9007 4 месяца назад
Nice video man. That's was really interesting. Have seen cancellation tokens as an optional parameter to functions all the time but never really saw their purpose.
@RahulNath
@RahulNath 4 месяца назад
Great to see you here Bryce and glad it was helpful!
@ChosenHandle
@ChosenHandle 4 месяца назад
Really nice video on the tooic. Thank you.
@RahulNath
@RahulNath 4 месяца назад
Glad you enjoyed it!
@juniorzucareli
@juniorzucareli 4 месяца назад
Excellent video!
@RahulNath
@RahulNath 4 месяца назад
Thank you very much!
@abuzeromohammed3386
@abuzeromohammed3386 4 месяца назад
Thank you Rahul
@RahulNath
@RahulNath 4 месяца назад
Glad you liked it Raghad.
@johncerpa3782
@johncerpa3782 4 месяца назад
Thanks for the video
@RahulNath
@RahulNath 4 месяца назад
Glad you liked it John!!
@SuriyasankarP
@SuriyasankarP 2 месяца назад
Hi Sir..First of all it's a great video.. I have one query... I have a main function and that main function has one sub function.. Like Main{ Sub{ Inner 1{ Inner 1.1 } Inner 2{ Inner 2.1} Etcc... } } If I cancel Sub function with cancellation token..all the respective inner function also will cancel and it save resources right?? Or need to pass cancellation token all of the inner function for releasing the resources?? This is my query... If you answer it would be better🙂🫡
@ramashankar2750
@ramashankar2750 4 месяца назад
Using an idempotence along with a state machine do the job.
@RahulNath
@RahulNath 4 месяца назад
Sorry didn’t understand. Idempotency is an important concept but not sure how that helps here if you are cancelling out in between a chain of process/ functions
@ramashankar2750
@ramashankar2750 4 месяца назад
@@RahulNath Implementing cancellation token on Mircroservices using Azure functions can be a challenge due to racing/multithreading, we implemented the idempotence for the key under consideration that passes through multiple states (optional) validate/ cancel/ secure/ do/ release/ undo/ queueing/ feedback/ webaudit/ tracker/... to minimise it by responding quickly an seting up state machine to cancel duringthe process of task (10-20 tasks for an Invoice) with a transaction engine (we call it DoProcess) to overcome issues in it. e.g we will hold a E-mail to a vendor for 30 minutes before change of mind by the user. towards cancellation , we learnt over decades users issues. feedback state setsup the cancellation state and engine decides its fate. We needed Speed / Robustness/Diagnostics for support/Lean.
@ramashankar2750
@ramashankar2750 4 месяца назад
@@RahulNath We do not process the Request immediately but log it and send a feedback to user. Now cancellation becomes easy at any stage with idenmpotence applied (do not know what will fail and get recitified). The queue is processed like 60s/70s era of batch processing replacing the procedures with microservices for maintenance of code, and we use on premise DB in India as companies do not want their data to kept on cloud.
@RahulNath
@RahulNath 4 месяца назад
@@ramashankar2750 Absolutely using messaging would help solve a lot of these issues. I did mentioning about it in my previous video on CancellationTokens and long running processes. But when you do run into scenarios like this in your API endpoints or other synchronous processing mechanisms it's good to follow these patterns with the token. Thank you for the comment and the call out here 👍
@parmarjitesh1979
@parmarjitesh1979 4 месяца назад
Hi cancellation tokens are not working when calling api from flutter , can you help sir ?
@RahulNath
@RahulNath 4 месяца назад
Can you provide more details on how you are using it from flutter ? How are you calling cancel on an API?
@parmarjitesh1979
@parmarjitesh1979 4 месяца назад
I am calling a api endpoint for eg : localhost:5010/odata/CHECKSTOCK?PRODUCTID=123. This request is working fine but when the user checks for multiple times stocks of different product and sometimes user generates a request but cancels it mid-way than the cancellation token is not getting trigged and than iis throws error too many files open and i think some memory leak happens and application gets very low, sir googled all possible ways but couldn't figure it out. if u could throw some light than it will be helpfull @@RahulNath
Далее
Build Clean Messaging in .NET with MassTransit
21:44
Просмотров 97 тыс.
What’s new in Angular v18
20:08
Просмотров 117 тыс.
I've been using Redis wrong this whole time...
20:53
Просмотров 353 тыс.