Тёмный
No video :(

Async/Await an Introduction (Asynchronous programming in .NET 5.0) 

DotNet Core Central
Подписаться 27 тыс.
Просмотров 16 тыс.
50% 1

Asynchronous programming is a norm than an exception these days where every machine and server are packed with CPU. It would be a shame not to use the parallel processing power of the machines.
The Task Asynchronous Programming (TAP) model makes asynchronous programming a piece of a cake. In this video, I am going to walk through some of the basic functionality implementations of asynchronous programming using async/await of task asynchronous programming model implementation.
I am going to use an example of a driver delivering goods to a distribution center. Where multiple tasks can potentially occur in parallel, whereas there would also be some dependency between the tasks. This creates a near-real-time scenario of asynchronous programming.
Features used in this video are as follows:
1. async/await
2. Task.Delay
3. Task.WaitAll
4. Task.WhenAll
5. Task.WaitAny
Url to my website: dotnetcorecent...
Url to my GitHub repo: github.com/cho...
If you wish to buy me a coffee: www.buymeacoff...
And thanks so much for all your support!

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

 

21 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 48   
@SohailKhan1981
@SohailKhan1981 3 года назад
Very clear and concise explanation. I read a few articles about it and watched some other videos but my concept was still not clear. You explained this very well. Keep up your good work.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Sohail Sarwar, thanks for watching!
@laughingalien
@laughingalien Год назад
Excellent work, sir! A very well thought out example. Thank you for sharing your knowledge.
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Thanks for watching!
@sharadabasa6114
@sharadabasa6114 Год назад
Such awesome video for all those who get confused with async and await .... Thankyou
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Glad you liked it
@juliansegura5507
@juliansegura5507 3 года назад
This might be the best tutorial I have seen about async/await
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Julian Segura, thanks for watching!
@user-cl3kj4it5l
@user-cl3kj4it5l 5 месяцев назад
It is awesome explanation done I hope you will do more vidios on Task
@arandomambipom9444
@arandomambipom9444 Год назад
This was great, ty
@DotNetCoreCentral
@DotNetCoreCentral Год назад
thanks
@bittusrivastava1
@bittusrivastava1 Год назад
thanks a lot for this video
@DotNetCoreCentral
@DotNetCoreCentral Год назад
You are most welcome
@avinandanpatra8867
@avinandanpatra8867 3 года назад
Excellent explanation, could you elaborate ConfigurureAwait methods and its use
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Avinandan Patra, thanks for watching! I will create a short video on some of these features.
@harishkommuri5350
@harishkommuri5350 3 года назад
Thank you, it was Indeed clear explanation, it was value add to me.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Harish Kommuri, thanks for watching!
@abidshaik9614
@abidshaik9614 2 года назад
Good one. Do a async await video with Database operations.
@TommiLipponen
@TommiLipponen 3 года назад
Excellent stuff! Thanks
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Finn, thanks for watching the video!
@ramankaplish3055
@ramankaplish3055 8 месяцев назад
Wonder ful learning thanks a lot dot. Net central team..
@kctripathy
@kctripathy 3 года назад
Excellent!!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Kishor C Tripathy, thanks for watching the video!
@2040ashish
@2040ashish 2 года назад
at 17:18 , how did the async Tasks start, as soon as we declared the async task, does it start ? like on line 18 and 19 ?? As per my understanding we need to start the task using Task.run(() => { } ) also in .net core web API we use Async and Await in all the Action methods, how does it give benefit there ?
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
if you go through the video the two methods ReportToBackOfficeAsync and VerifyAsync internally use Task.Delay to mimick a new task.
@eliassal1
@eliassal1 3 года назад
At minute 8:56, When you start using var driverTask, var verifierTask...... we get a warning when buildin as follows: All projects are up-to-date for restore. \Async.Await.Demo\Program.cs(14,27): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [\Async.Await.Demo\Async.Await.Demo.csproj] Async.Await.Demo -> \Async.Await.Demo\bin\Debug et5.0\Async.Await.Demo.dll Does this mean it is not a good practice
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Salam Elias, I am doing a Task.WaitAll just in the line below, which is a better approach. And if you use Task.WaitAll, you should not get the warning to use await, as Task.WaitAll is the same as calling await on each of the tasks but in parallel.
@eliassal1
@eliassal1 3 года назад
@@DotNetCoreCentral Ok got it, happy new year and hope you do more wonderful videos
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@eliassal1 thanks! and happy new year to you as well!
@mahendranchinnaiah7593
@mahendranchinnaiah7593 3 года назад
Thank you so much.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Mahendran Chinnaiah, thank you so much for watching the video!
@microtech2448
@microtech2448 2 года назад
Can you please explain with help of diagrams how and when threads switch and how they flow?
@Shaikhbarkat09
@Shaikhbarkat09 2 года назад
Can we create verifery async method without Task return type?
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
I am not sure I understand the question
@VerdonTrigance
@VerdonTrigance 2 года назад
why this is in 'advance' playlist? this is a basic stuff
@MTSightseeing
@MTSightseeing 2 года назад
Can u make a video on asp. Net core api in depth
@MTSightseeing
@MTSightseeing 2 года назад
Also make a video on repository pattern in api and mvc
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
Sure
@MTSightseeing
@MTSightseeing 2 года назад
@@DotNetCoreCentral upload as soon as possible
@hasan_shans
@hasan_shans 3 года назад
When we use async/await, does it create a new thread?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Hasan Shans, it will borrow a thread from the thread pool internally.
@hasan_shans
@hasan_shans 3 года назад
@@DotNetCoreCentral But is there a scenario when it doesn't use a thread at all? Because a lot of people recommend this article, where it states that async doesn't use a thread: Stephen Cleary - There is no thread
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@hasan_shans Based on my understanding and tests that I performed, if you await immediately after making an async call, there is no new thread, as I explained in this video itself when I showed the behavior. At that point there is no incentive to create a new thread, instead, it will continue on the main thread.
@hasan_shans
@hasan_shans 3 года назад
@@DotNetCoreCentral thank you!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@hasan_shans you are welcome!
@MTSightseeing
@MTSightseeing 2 года назад
Please