C# Advanced Async - Getting progress reports, cancelling tasks, and more

  Рет қаралды 289,650

IAmTimCorey

IAmTimCorey

Күн бұрын

Now that we know how to do the basics in async, let us take it to the next level. In this video, we look at how to get status reports back from asynchronous tasks so we can display a progress bar and more to the screen while they are running. We also set up the ability to cancel a long-running or hung asynchronous task.
We will also explore the differences between adding tasks in a foreach loop vs Parallel.foreach and how we can even get the benefits of both methods at the same time.
- Newsletter signup (with exclusive discounts): signup.iamtimcorey.com/ (your email will be kept safe and you will not be spammed).
- Source Code: leadmagnets.app/?Resource=Adv...
- Intro to Async / Await: • C# Async / Await - Mak...
0:00 - Intro
0:55 - Demo application walk-through
5:05 - Code behind demo application
12:00 - Implementing a progress report for tasks to be done
23:11 - Progress report recap
25:02 - Canceling tasks/methods; Cancellation tokens
33:58 - Canceling recap
35:34 - Parallel synchronous operation: Parallel.ForEach
41:38 - Parallel asynchronous operation
46:56 - Conclusions
50:26 - Summary

Пікірлер: 777
@hardgrafter2787
@hardgrafter2787 5 жыл бұрын
I am a professional WPF C# developer & find your resources by far superior to Pluralsight content. Very talented teacher, thank you so much.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are most welcome.
@jamiedewitz6832
@jamiedewitz6832 2 жыл бұрын
Either this [advanced] concept is really simple or was it just explained in such a way that it seems very easy to use..... I'm really glad I found these videos. This concept is a game changer, for sure. I wish I would've found these years ago!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Glad it was helpful!
@user-ci3pf5kc4z
@user-ci3pf5kc4z Жыл бұрын
Just awesome! I like your pace AND the way you highlight those small details which makes the difference in a real-world intuitive app! Thanks, Tim!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@parapadirapa
@parapadirapa 2 жыл бұрын
I cannot understate how much I love when Tim glues together 3 or 4 words in each phrase.. Saves me so much time =)
@tosinakinyemi3948
@tosinakinyemi3948 3 жыл бұрын
Both videos on Async / Await are awesome, from scratch to the advance with a visual touch. Wow you just open up my understanding of this topic. Bless you Tim Corey.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Great!
@AlexWardi
@AlexWardi 4 жыл бұрын
Learned quite a few things from watching this video and its predecessor. Thanks, Tim!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@vibhoregupta1742
@vibhoregupta1742 3 жыл бұрын
fantastic tutorial Tim. really loved the detail you covered in the video. Thanks🙏
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Thank you for continuing your learning with Tim.
@TheTonyBTube
@TheTonyBTube 2 жыл бұрын
Tim, it was your approach to teaching, your competency and your conciseness that made it a pleasure to subscribe to your Annual Pass. I look forward to learning more. Well done!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thank you! I am glad you are finding my content so valuable.
@F0YF0YT0S
@F0YF0YT0S 6 жыл бұрын
Once again: perfection in explanation, presentation and execution. Thank you Tim :)
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome.
@rwpage89
@rwpage89 4 жыл бұрын
Man I can’t believe how much I learned from your videos. I’ve gotten back into C# development for my job which involves a lot of automation. My tools are internal to our team, just basically making tools to automate a lot of mundane tasks that eat up our time. Can’t thank you enough for your help, you most definitely earned my sub
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are most welcome. Thanks for watching.
@oritnaftali4542
@oritnaftali4542 Жыл бұрын
Tim, You are a great teacher! You explain complicated stuff in a clear and comprehensible way. I lean a lot from all your videos. Thank you!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You're very welcome!
@marcelolopes1347
@marcelolopes1347 4 жыл бұрын
Your videos are pure gold. Superb explanation, excellent didactics, and execution sequence. Thank you so much.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thank you!
@yaroslavkostetskiy3665
@yaroslavkostetskiy3665 Жыл бұрын
Tim all materials you've posted are awesome! Good luck and affluent numbers of students to you!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thank you.
@abhishekjadhav9289
@abhishekjadhav9289 Жыл бұрын
Great video again. It helped me clear in my mind the actual difference between Task.WhenAll and Parallel.ForEach. Hats off to you Tim. Thanks for breaking down tough things in easy to understand manner for us.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@arugollu
@arugollu 5 жыл бұрын
I liked the video and able to follow and try the concepts with an example on my laptop. The concept is clear. Thanks a lot Tim.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are most welcome. Thanks for watching.
@GuildOfCalamity
@GuildOfCalamity 3 жыл бұрын
Great demo! NOTE: You'll want to create a new cancel token before calling the async because on the next try the token will still be canceled. CancellationTokenSource cts = null; // At declaration (top of class) ... // In the executeAsync_Click() method... cts = new CancellationTokenSource(); var results = await DemoMethods.RunDownloadAsync(progress, cts.Token); PrintResults(results); ... // In the cancelOperation_Click() method... if (cts != null) cts.Cancel();
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Thanks for sharing
@popinpavel8589
@popinpavel8589 2 жыл бұрын
Exactly what i was looking for, thanks!!
@NOCKSCITNEY
@NOCKSCITNEY 2 жыл бұрын
Was about to report the same thing, but found your comment 👍
@AngrejSingh-uc7uw
@AngrejSingh-uc7uw 4 жыл бұрын
Brilliant stuff mate. I was struggling with this for a while, cheers for clearing it up.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad it helped
@pauldechampignon2287
@pauldechampignon2287 3 жыл бұрын
Thank you Tim. You are one of the very few video creators with real passion for what you do and for teaching people. Your videos are done in perfect pace, you stop at important parts and explain them. Simply amazing!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
I appreciate that!
@ShyamSundar055
@ShyamSundar055 3 жыл бұрын
It completely opened my mind. Thanks Tim for your amazing explanation.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are welcome.
@manju_narasimha
@manju_narasimha 3 жыл бұрын
Thank you so much for this video Tim! Never thought anybody cud explain me async operations so easily!
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Thanks for trusting Tim for your training.
@Dame4Lyf3
@Dame4Lyf3 6 жыл бұрын
Tim, sir, you're keeping me employed. It's sometimes hard finding these types of content and (especially C#) you just provide when needed.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Awesome! I'm glad you are getting a real benefit out of the content.
@jebwatson
@jebwatson 3 жыл бұрын
Honestly the best, most concise summary of a topic I find myself struggling with constantly. Excellent resource for software professionals and amateurs alike. Well done!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks!
@ArbazAbid
@ArbazAbid 4 жыл бұрын
Thank you for your videos, I have learned a lot about advance async and await methods. God bless you Tim.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are most welcome. Thanks for watching.
@danj8404
@danj8404 2 ай бұрын
Thank you for these videos. I really appreciate that you point out what comes from the .NET framework or built into to C#.
@IAmTimCorey
@IAmTimCorey 2 ай бұрын
You are welcome.
@romansidler
@romansidler Жыл бұрын
Thanks Tim for this great video tutorial. This was just helping to point myself into the right direction implementing some code for a massive parallel backup job.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Excellent!
@yingxing4134
@yingxing4134 2 жыл бұрын
Finally a tutorial that doesn't assume the viewers are experts already, I am able to follow and understand completely! Awesome work Tim, thank you!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@vinuhosanagar1
@vinuhosanagar1 6 жыл бұрын
Thank you Sir. I was remembering you for all value you have been giving. And when I opened KZfaq got your notification.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome. I'm glad I'm providing value.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Hey, did you delete your last comment about your comments being deleted? I saw it but didn't respond at first because I wanted to look into it. When I went to respond, it was gone.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
By the way, email me about this please instead of replying. I have a hard time finding deep replies. Email is tim (at) iamtimcorey (dot) com
@mailtovinodrajput
@mailtovinodrajput 5 жыл бұрын
Excellent demo of Async - Parallel -Progress ever been seen !!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I appreciate the kind words.
@miraichampion3366
@miraichampion3366 11 ай бұрын
Everytime my lead dev asks me to do smthing confusing im like... "If theres a TimCorey for it im good". Today was cancelation tokens and logging. Cheers for saving my bacon again dude.
@IAmTimCorey
@IAmTimCorey 11 ай бұрын
Awesome! Thanks for sharing!
@CaracalCaracal
@CaracalCaracal 3 жыл бұрын
Cleary and great explanation... both videos show me a big diff between normal method and with async await method. luv the way u explain it
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Glad it was helpful!
@SelmanErhanekici
@SelmanErhanekici 4 жыл бұрын
This was a great video. Understandable and informative. Thanks a lot. The hard thing is not how hard the problem is. The real problem is to explain it simply and easily, no matter how difficult it is. It's more difficult to simplify and make it understandable. This is what you doing your videos.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thank you!
@RemixProf
@RemixProf 6 жыл бұрын
When I see Tim upload a C# video world gets beautiful for an hour :)
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'm glad. Hopefully there will be many beautiful hours to come.
@srinunosina40
@srinunosina40 4 жыл бұрын
Nice Article on Async. Thanks a lot for all your work! It's amazing!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@jackbrabham
@jackbrabham 2 жыл бұрын
I was having an awful time trying to make a bunch of legacy code I can't really change to run faster. Found your first video on async/await and managed to shave off a ridiculous amount of time. You are a life saver, thank you so much for your help!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Excellent!
@stevesynan3910
@stevesynan3910 5 жыл бұрын
Awesome videos man! Keep it up! I've been been programming for years but certain concepts I tend to avoid, like asynchronous programming. I really like the way you break everything down into simple digestible steps and don't spend hours digging into historical context that is irrelevant for today, you get right to the nuts and bolts. I have already sub'd but I'd do it again if I could! Thanks for spreading the knowledge!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I'm glad you are enjoying them and getting value out of them.
@89GDC
@89GDC 3 жыл бұрын
these tutorials have helped me to understand a lot. Thanks Tim!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
My pleasure!
@krishravela
@krishravela 2 жыл бұрын
Hey Tim, I just finished Advanced Async course and to be honest, I learned so many things even though I have been working on c# for the last 8+ years . Keep up the good work
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I am glad it was so helpful.
@zeroskill990
@zeroskill990 3 жыл бұрын
Tim, if it weren't for you, I'd still be messing around with a console application that does nothing useful. Your videos are one of the greatest learning sources I've ever come across. You've taught me many essential things in C#. Great work. Other resources are nothing compared to what you provide (even for free!)
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
I appreciate the kind words.
@jeremyrooks9784
@jeremyrooks9784 2 жыл бұрын
💯
@harishpatil5621
@harishpatil5621 3 жыл бұрын
I was very confused between synchronous and asynchronous programming & how to use async/await keywords. This video cleared my all confusion. Thanks you so much.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Wonderful!
@nguyenkhoa1043
@nguyenkhoa1043 4 жыл бұрын
Great work! Amazing Parallel steps up my journey!!!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks!
@MrHonest10000
@MrHonest10000 3 жыл бұрын
Excellent demo and explanation. Much appreciated Tim.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Glad it was helpful!
@dormelamed5974
@dormelamed5974 3 жыл бұрын
Tim My man! Your videos are great! keep up with this amazing work! your explanations skills are priceless!!!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Glad you like them!
@BlazorBill
@BlazorBill 4 жыл бұрын
Thank you Tim. Very helpful. Made a significant impact on an app I'm building.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Excellent!
@AnuragSunmugam2201
@AnuragSunmugam2201 4 жыл бұрын
very well covered! you make everything so understandable. thanks man
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@aimanemeish3482
@aimanemeish3482 3 жыл бұрын
Dear tim, Again one million thx. as always, it's just very helpfull and explained in a so simple way that even at nearly at 50 years (in my cas) we just feel again as at university.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You're very welcome!
@rolandwatz7797
@rolandwatz7797 3 жыл бұрын
Thank you very much again. Once again a great video Tim! You are a natural born teacher! Best regards from Germany and God bless you.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are most welcome. Thanks for watching.
@shadizidan7295
@shadizidan7295 2 жыл бұрын
Amazing . Love you Tim . You are really making it simple
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 2 жыл бұрын
Thanks for trusting Tim and looking to him for assistance
@Efficienthacks
@Efficienthacks 5 жыл бұрын
excellent tutorial - i like the way you built it up in increments
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you!
@alvaronavasmodrono8057
@alvaronavasmodrono8057 2 жыл бұрын
Really neat! was going crazy trying to make the BackgroundWorker class run, and this is so much better, specially when explained like this. Thanks!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I am glad it was so helpful.
@artuskoenich8377
@artuskoenich8377 Жыл бұрын
@@IAmTimCorey 4 years later this is still a valid and very good explanation. Actually with these 2 videos I was able to really understand what is "under the hood" of the Backgroundworker. Would you nowadays recommend to use the BGW or use a selfmade async method with progress report and cancellation? (provided both functionalities are needed)?
@EngDuraid
@EngDuraid 5 жыл бұрын
You are the best as i always say, thank you very much Mr. Corey
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you!
@MrMarsburgToYou
@MrMarsburgToYou 2 жыл бұрын
Another excellent presentation! Thank you Tim!
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 2 жыл бұрын
Thanks for investing your time with Tim
@jitendrarajbhar9286
@jitendrarajbhar9286 4 жыл бұрын
Thanks Tim , Great learning lot and clear about parallel.foreach
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@manjunathpn2393
@manjunathpn2393 4 жыл бұрын
Thanks Tim Corey... Its a great learning for me... Thanks once again..
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@alialamdari4375
@alialamdari4375 5 жыл бұрын
Well-explained video. Many thanks Tim.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are welcome.
@hamidrezaashkiyan
@hamidrezaashkiyan 4 жыл бұрын
Thank you very much Mr.Corey. This video ( and the previous one ) was amazing And I got all of it. It helped me alot.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are most welcome. Thanks for watching.
@citypavement
@citypavement Жыл бұрын
I'm watching the end of the progress bar part thinking "Wow, I can't wait to do this. I will have to re-watch this and follow along but I should be able to figure it out if I try." Tim Corey: 24:48 Seriously, though. This is explained extremely well. Thank you!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@AlecPaulKISS
@AlecPaulKISS 5 жыл бұрын
Been struggling with creating a ASYNC fileDownloaded, but succeeded using CLASSES without using any threads, it works but the code was like spagetti, overlaps and overloads etc. So decided to revisit the code from last year and try to enhance my knowledge and using threads and tasks.. it worked to a certain point using Delegates and SafeData methods and invokes etc.. but still was not 100% something to be proud about, until I ran across your videos TIM.. thank you for the examples and level of detail and the download site.. AMAZING work.. and very much appreciated.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Awesome! I'm glad it helped out.
@oleksiipotapov9667
@oleksiipotapov9667 4 жыл бұрын
Thanks a lot for all your work! It's amazing!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@kopilkaiser8991
@kopilkaiser8991 Жыл бұрын
You are the best teacher to teach C# programming tutorials. I really understand your concepts in-depth as you explain with keeping everything in mind. Not too vague, or not too complex. Just enough spices to make the recipe (knowledge) tasty to consume! Aromatic and delightful. Please keep up the hard work. I pray for your wellbeing and may you be blessed with more success. InshaAllah 🤲❤. Lots of love from me brother.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thank you!
@ramialbadri3114
@ramialbadri3114 3 жыл бұрын
Your videos is really helping me preparing for my new C# job, since I come from Java world. Keep it up man :)
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Glad I could help!
@10tronic
@10tronic Жыл бұрын
Muchas gracias Tim. Que hermosa explicación!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@Lvl9chao
@Lvl9chao 4 жыл бұрын
really learned a lot from this async/await series!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Excellent!
@19gauravmittal91
@19gauravmittal91 4 жыл бұрын
Thanks Tim for make this easy to understand. I am looking for multithreading from you.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad to help
@pirouz_roshanzamir
@pirouz_roshanzamir 2 жыл бұрын
Sir you have made my life easier beyond any thank you
@jacintomichaelpalaroan2795
@jacintomichaelpalaroan2795 2 жыл бұрын
Appreciate the detailed discussion. 5 stars!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thank you!
@diskokaktus
@diskokaktus 3 жыл бұрын
Thanks A LOT man, you really did better than my whole university program
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
I’m glad it was helpful.
@belmiris1371
@belmiris1371 4 жыл бұрын
This video and your Basic Async / Await video were very helpful, thank you. I would like to see a video on how and where exceptions are best handled. Thanks!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I will add it to the list. Thanks for the suggestion.
@shashikantchitalkar4788
@shashikantchitalkar4788 3 жыл бұрын
Great work Tim. Most Appreciated..Thank you..
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are welcome.
@TheJessejunior
@TheJessejunior 4 жыл бұрын
amazing job as always tim!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thank you!
@khaledbudajaja6137
@khaledbudajaja6137 5 жыл бұрын
Well explained, many thanks Tim
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are welcome.
@MichaelJordan-jv6ic
@MichaelJordan-jv6ic 4 жыл бұрын
I very much appreciate your teaching skill. I might note that with the examples of IProgress that I've seen to this point, there is usually a null check involved in calling Report(). I'm not entirely sure of the reason at this point, but thought this might be useful.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
The reason is in case the reference has been destroyed or was null to begin with.
@kongwengseng3735
@kongwengseng3735 3 жыл бұрын
Wow, you are a great mentor. Thanks.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
My pleasure!
@guyprovost
@guyprovost 5 жыл бұрын
Great stuff, thanks for sharing the knowledge!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are welcome.
@waynemurphy7239
@waynemurphy7239 5 жыл бұрын
I concur with "InDeep Software". I've been programming for 40 years and this is the most effective approach I've come across. I've been using PluralSight lately, which can be good. This is better ... Thank you!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I appreciate the kind words.
@shwetankSaptarshi
@shwetankSaptarshi 5 жыл бұрын
Really well explained.Thanks
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are welcome.
@jegtugado3743
@jegtugado3743 4 жыл бұрын
This series is very helpful. Though I am familiar with async await in .net, I wasn't sure how to get better performance with it. Well done sir. 💯
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thank you!
@georgekerwood9100
@georgekerwood9100 4 жыл бұрын
Another great, exhaustive but clear video. Thank you! You, Sir, have earned a subscribe :)
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are most welcome. Thanks for watching.
@mohammedkhalil7051
@mohammedkhalil7051 2 жыл бұрын
I hit like button before I watch the video case I'm sure it will be useful and enjoining. Beside that, my native language is Arabic and I understand the clear and simple English you use in videos. Thanks Tim.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are most welcome. Thanks for watching.
@DanFlakes
@DanFlakes 3 жыл бұрын
Thanks for the in depth video!
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Thanks for trusting Tim
@naweedsyed1556
@naweedsyed1556 Жыл бұрын
Very good explanation thank you!!
@jonataspc
@jonataspc 2 жыл бұрын
Very helpfull video. Thanks Tim, keep it up!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@jayschwarz4365
@jayschwarz4365 7 ай бұрын
Really great explanation of a fairly complex topic.
@IAmTimCorey
@IAmTimCorey 6 ай бұрын
Thank you!
@mustafabeshr2009
@mustafabeshr2009 4 жыл бұрын
thank you so much ,finally I got what i looking for for months.... thank thank thank you ...
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Excellent!
@0i0l0o
@0i0l0o Жыл бұрын
Corey, maybe exploring ValueTask and it's use cases would be good continuation of these async series.
@kk3528
@kk3528 2 жыл бұрын
Brilliant ...so helpful n so well explained 🙏
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thank you!
@vigneshchandrasekar328
@vigneshchandrasekar328 2 жыл бұрын
This is by far the best video on async/ await in c# and the content beats any of the paid video sources out there. I have a question is there a way to pause-resume operation instead of just canceling it?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You would need to build that into the called method. It isn't a standard feature.
@pitstopkrew
@pitstopkrew 4 жыл бұрын
Clink...... that was the penny finally dropping, great video, thanks!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Awesome!
@nenojay6832
@nenojay6832 6 жыл бұрын
love your C# videos a lot
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'm glad.
@exec3636
@exec3636 2 жыл бұрын
Useful content thank you very much , From Dev from Thailand.
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 2 жыл бұрын
Thanks for watching
@siddharthgoel9012
@siddharthgoel9012 4 жыл бұрын
Great Video Tim!!!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks!
@nullentrophy
@nullentrophy 3 жыл бұрын
Hi Tim. Actually I am a bit surprised that you didn't include Multithreading vs Async. I confuse those topics a little. It would be nice to learn them from you. Thanks for awesome content!
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Thanks for the suggestion, I added it to the list.
@RalfsBalodis
@RalfsBalodis 3 жыл бұрын
0:00 - Intro 0:55 - Demo application walk through 5:05 - Code behind demo application 12:00 - Implementing a progress report for tasks to be done 23:11 - Progress report recap 25:02 - Canceling tasks/methods: Cancellation tokens 33:58 - Canceling recap 35:34 - Parallel synchronous operation : Parallel.ForEach 41:38 - Parallel asynchronous operation 46:56 - Conclusions 50:26 - Summary
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks! I added it to the description.
@hiranstechview8550
@hiranstechview8550 2 жыл бұрын
Really Informative. Thanks a a lot.
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 2 жыл бұрын
Thanks for watching
@denis.akopyan
@denis.akopyan 6 жыл бұрын
Just what I needed! Thank you
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Great!
@madhavkshirsagar2466
@madhavkshirsagar2466 3 жыл бұрын
Thanks for showing the gradual improvements you made from basics to advanced! Now I am beginning to understand how async/await is used. I have 2 questions 1. How to include threads in a flow chart. If I had to draw flow chart for this program how would I include threads? 2. Where is the progress.ProgressChanged (from MainWindow.executeAsync_Click()) invoked? I didn't see ProgressChanged ?.Invoke(this, ProgressReportModel); anywhere in the code!
@dnwheeler
@dnwheeler 2 жыл бұрын
Just a few comments: 1) the CancelationTokenSource cannot be "reset" and a new one must be created for each use. 2) Parallel.ForEach uses multiple threads for each "chunk" of work, whereas the Task.WaitAll() method doesn't use threads. 3) In the Parallel.ForEach case, you might be able to use a ContinueWith to add the common progress handling as each download finishes (I haven't tested this, and it probably isn't a recommended technique).
@ajonescouk
@ajonescouk 4 жыл бұрын
Thanks - I learnt a lot for this. One slight thing - if the cancellation was checked *after* progress is reported it would be a little more accurate. When you cancel at 50%, the code has actually completed 60% of the downloads, but the reporting callback hadn’t been called. I know it doesn’t matter for this example, but there could be instances where that information is useful.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
True. Thanks for pointing it out.
@mauriziofocareta8846
@mauriziofocareta8846 3 жыл бұрын
Really good lessons, really good teacher, thanks !
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You're very welcome!
@ravishchauhan1
@ravishchauhan1 4 жыл бұрын
Nice Video sir. Thanks a lot for sharing your knowledge.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@timyoung6495
@timyoung6495 Жыл бұрын
This is a really excellent video. I would love to see something similar for VSTO with C# for Excel. I'm finding it really hard to get good and easy to follow best practice info on how to show long running tasks in forms in with a responsive progressbar. But a series on building Excel add-ins in a best practice manner with VSTO in general would also be wonderful. Thanks for the awesome content!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
@maximeumbra7235
@maximeumbra7235 Жыл бұрын
You can also build an average metric and predict your progress. Say in this example average the time a few times running the method for a given byte size and you can remap with the expected value.
@DarkSolidity
@DarkSolidity Жыл бұрын
I’ve got a pretty large code base for Excel automation in C#, if you still need help. What are you trying to do?
What's New in C# 8.0 - Is There Multi-Inheritance Now?
1:23:33
IAmTimCorey
Рет қаралды 61 М.
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 21 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 70 МЛН
That's NOT How Async And Await Works in .NET!
12:25
Codewrinkles
Рет қаралды 15 М.
8 await async mistakes that you SHOULD avoid in .NET
21:13
Nick Chapsas
Рет қаралды 308 М.
Await Async Tasks Are Getting Awesome in .NET 9!
9:24
Nick Chapsas
Рет қаралды 87 М.
Settling the Biggest Await Async Debate in .NET
14:47
Nick Chapsas
Рет қаралды 139 М.
Delegates in C# - A practical demonstration, including Action and Func
1:09:11
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 21 МЛН