C# Async / Await - Make your app more responsive and faster with asynchronous programming

  Рет қаралды 1,016,794

IAmTimCorey

IAmTimCorey

Күн бұрын

Пікірлер: 2 200
@dirkvaneester2946
@dirkvaneester2946 4 жыл бұрын
Tim, Thanks. This is the only "usable" explanation I found about async programming.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad it was helpful.
@camdynvalentin9051
@camdynvalentin9051 3 жыл бұрын
sorry to be off topic but does any of you know of a method to log back into an Instagram account?? I was stupid lost my login password. I would appreciate any tips you can offer me!
@camdynvalentin9051
@camdynvalentin9051 3 жыл бұрын
@Pedro James thanks so much for your reply. I found the site thru google and I'm in the hacking process atm. Seems to take a while so I will reply here later when my account password hopefully is recovered.
@camdynvalentin9051
@camdynvalentin9051 3 жыл бұрын
@Pedro James it worked and I actually got access to my account again. I'm so happy:D Thank you so much you really help me out !
@pedrojames6149
@pedrojames6149 3 жыл бұрын
@Camdyn Valentin happy to help :D
@zoran123456
@zoran123456 5 жыл бұрын
I am senior .NET developer and I still use your tutorials and love watching you. One can never know enough. You are really awesome teacher and this tutorial on async/await is just what I needed. I know it is something what we are supposed to use, but not really have any real knowledge on WHY exactly. So awesome, especially with parallel.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Awesome! I am glad my videos are still helpful.
@b213videoz
@b213videoz 3 жыл бұрын
One can, but probably two can't
@FunnySubmarine-ij4zk
@FunnySubmarine-ij4zk 8 ай бұрын
Mr. Tim, One of the advantages of C# is that you teach it.
@IAmTimCorey
@IAmTimCorey 8 ай бұрын
I appreciate the kind words.
@TheMedicinMannen
@TheMedicinMannen 4 жыл бұрын
Just another student passing by to say thank you! Your slow and steady learning method is so much better than "Become a C# master in 5 minutes" type of videos
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You're very welcome!
@briank.daniels7939
@briank.daniels7939 4 жыл бұрын
It is amazing how you wrestle complicated subjects to their knees with such a smooth narration that is so easy to follow and understand. Thank you!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I appreciate that!
@EvanDear
@EvanDear 6 жыл бұрын
Thank you Tim. I've been looking for video tutorials like this for a LONG time now. Your C# video tutorials are taught so nicely and you make it easy to understand. Most programming tutorials are either too fast or slow. Most videos have terrible audio but yours is beautiful. You are so helpful, please don't stop making videos.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I appreciate the kind words.
@CodeZeeZ
@CodeZeeZ 3 жыл бұрын
As someone who have learned async as "This is how you do async in the code. Don't ask why just do it" I never really understood why. I understood that the program could run asynchronous but never really grasped why or rather how it ran asynchronous. After the 25 minute mark I got the Ooooh now I get it. Thank you so much.
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Thanks for watching and trusting Tim to be a part of your coding journey.
@sparking023
@sparking023 3 жыл бұрын
same here. I have a solution full of external api calls database access, and they all "run asynchronously". I followed tutorials and troubleshot some caveats, but never really understood how to tackle async calls to make it actually efficient. Guess I have a lot of code to review now :)
@EnergizerTX
@EnergizerTX 8 ай бұрын
I'm a sr dev, and enjoy watching tech videos now and then, especially in the background as noise while working. I always enjoy your videos, recently discovered, as they provide different perspectives in how things are done or explained. I find explaining technical things like this to non technical persons a challenge, but you keep it simple, my motto, and that helps me to communicate with non technical peeps...
@IAmTimCorey
@IAmTimCorey 8 ай бұрын
I'm glad you find them valuable.
@mohamedmotaz1116
@mohamedmotaz1116 4 жыл бұрын
Tim, I can't say this enough. You are the best ever! You're videos are on a level of their own. No courses or videos I have seen explain stuff as good as you! Thank you for everything!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Wow, thanks! I appreciate that.
@0lay3mi
@0lay3mi 4 жыл бұрын
Even after one year, and this is still my best explanation of async/await in C#. Thank you, Tim.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@claya1532
@claya1532 2 жыл бұрын
Been diving in C# lately and I just couldn't get async/await/Tasks to click until watching this. Thank you for breaking each piece down and making them less intimidating to use
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@truptibaliarsingh5441
@truptibaliarsingh5441 3 жыл бұрын
Hi Tim,I am in love with your teaching. The way you teach it becomes very easy to understand. Thanks for all your effort you put in to help us.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are welcome.
@engineerchaos8424
@engineerchaos8424 Жыл бұрын
God bless you. You have cured my confusion of async, await, and running tasks in parallel all in one go. I tried going everywhere: chatgpt, stackoverflow, google, and none of them answered all of my questions - ok except getting to you from google... You answered all of my questions and then some. Keep up the good work. Bookmarking this and going back to this video again and again.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I am glad it was helpful.
@godfathermikal
@godfathermikal 5 жыл бұрын
I have watched this tutorial about 10 times now and I get more and more understanding each time as I implement async in my apps where some methods I have control over and some I don't. This is seriously a huge help! Thank you so much for making this!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Awesome! I'm glad it has been so helpful.
@mrsajjad30
@mrsajjad30 4 жыл бұрын
After struggling for many days with async /await, finally this is the ONE video that answers all my questions. No matter how much I thank you it will be less for your awesome tutorials. You do have a GOD gifted quality of explaining complex things in a very simple manner. "It is your goal to make C# easy for us" and you are nailing it. Thank you so much.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad it helped! Thanks
@jeffg4686
@jeffg4686 6 жыл бұрын
Best video on tasks I've seen so far. Not confusing in the slightest anymore.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Excellent!
@thesophisticatedvelocirapt7320
@thesophisticatedvelocirapt7320 3 жыл бұрын
Found your channel like a week ago, and I've been watching at least one video every day, and I'm learning a lot. Thank you Tim Corey, and you do make learning coding easier
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Great to hear!
@adityamankal4740
@adityamankal4740 5 ай бұрын
Perfect explanation. Crisp, relatable, and organised. Thank you, Tim!
@IAmTimCorey
@IAmTimCorey 5 ай бұрын
You are welcome.
@Ricks_Shorts
@Ricks_Shorts 4 жыл бұрын
The best and clearest explanation of async/await I have ever seen. Look forward to watching some of your other videos.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Awesome, thank you!
@shadowzinny
@shadowzinny 4 жыл бұрын
i agree 200%! Well done!
@raskand1977
@raskand1977 6 жыл бұрын
Loved this! This was my first Tim Corey video, but I have to say he is the best presenter I've seen on the topic. He takes it easy, explains thoroughly, and somehow managed to explain EXACTLY the issues I had on mind after seeing other videos and reading some material. Many thanks!
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Awesome! I am glad you found it so valuable.
@RalfsBalodis
@RalfsBalodis 4 жыл бұрын
0:00 - Intro 2:23 - Demo application walk through 4:33 - Code behind the demo application: Synchronous operation 10:36 - Creating Async Task 22:39 - Creating Parallel Async 30:51 - Recap 33:00 - Wrapping method in Task.Run() vs Async methhod call 35:42 - Summary
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks! I added it to the description.
@MichaelHortonNow
@MichaelHortonNow 3 жыл бұрын
Hey Tim - I know this is an old post, but still relevant and useful today. Well done! Perfectly succinct and easy to understand. I've been looking for supplemental teachings for our new team members that won't take a week to consume, and it was a blessing to stumble across your channel. Thank you for sharing and make it a Merry Christmas!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Glad it was helpful!
@josephpatchen3421
@josephpatchen3421 2 жыл бұрын
DUDE! Thank you so much!! This was my third attempt trying get a working understanding of Async/Await and this did the trick! You are a baller!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Awesome!
@dc03yo
@dc03yo 6 ай бұрын
Outstanding C# async/await presentation, Tim! This is the clearest, cleanest overview I've reviewed regarding this topic. I appreciate how each example shows a different approach while stating the benefits and costs of each. A simple view compares the performance of each approach.
@IAmTimCorey
@IAmTimCorey 6 ай бұрын
Thank you.
@nathanielriehl623
@nathanielriehl623 6 жыл бұрын
OMG been working at this on and off for so long and not figuring out what I was doing right/wrong. Thank you so so so much!!!! I completely understand now and see a productive week at work coming my way. Best tutorial ever!
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Awesome! I'm glad it finally clicked.
@jeffwang1715
@jeffwang1715 3 жыл бұрын
The best one that I've seen. Impressed how you can explain such a complicated concept in such a simple way!
@leonsoares7405
@leonsoares7405 5 жыл бұрын
Before I watched this, based on everything else I had watched, I just though Async methods always had to be followed with Await keywords next to the sub tasks within the methods even though they were completely unrelated sub tasks. And I wondered why my apps still ran "synchronously"! This is such a good video introducing one to asynchronous programming the right way! Thank you for taking the time to put this together! Now over to your advanced async video!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are most welcome. Thanks for watching.
@muratkabak6212
@muratkabak6212 3 жыл бұрын
Wow, that was incredible. I had just learnt the syntax of the keywords but didn't understand what they do and how they'd be useful. This video showed me exactly what I was looking for. Thank you so much .
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 жыл бұрын
Tim's goal is true education. As you point out, that is more than just memorization of syntax and keywords. We are glad you found the video helpful!
@shaynemurray6351
@shaynemurray6351 6 жыл бұрын
Great work Tim, I like the way you overview the basics first then come back & drill down. You are a gifted teacher.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I appreciate the kind words.
@HarveyMyers
@HarveyMyers 3 жыл бұрын
I've been using these statements for 2 years now, and you just expanded my knowledge. Man, when I hit a demo where they start by creating a project I move on. Thanks for making every minute so full.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are most welcome. Thanks for watching.
@gauravparvat5291
@gauravparvat5291 6 жыл бұрын
The best explanation of Async Await by far without a lot of fuss and confusing terms!!!
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thanks!
@billhall5131
@billhall5131 3 жыл бұрын
Thanks!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are welcome and thank you!
@ted88
@ted88 5 жыл бұрын
Excellent video. I'm doing a course where we are shown how to make a web server and next task was to make it run async. I did that following the provided tutorial but that didn't help understand what is going on exactly. Plus it's always better to see it explained in a simple app like what you did. Thank you for this tutorial. For me 30 minutes is considered a short tutorial. 10-15 would be too short to understand and this was perfect and straight to the point. You explained everything in a couple of different ways and never strayed away from the topic at hand. It's rare to see such well structured tutorials. I will be back for more! (this reminded me of an old game called Chessmaster, you explain things in a similar fashion to the Grandmaster (Joshua Waitzkin) who did the tutorials in that game)
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Excellent! I'm glad it was so helpful to you.
@aksands9929
@aksands9929 4 жыл бұрын
Your lessons worth tens of books and dozens of universities, THANK YOU Tim
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad my content has been helpful.
@esdenaze
@esdenaze 4 жыл бұрын
The relaxed, composed way of explaining this is absolutely sublime - I found the example code for delegates to be very complex; but here it was a treat. You also managed to handle all possible errors I already encountered before that other youtubers seemed to treat as evident. Kudos to you!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad it was so helpful.
@dewaldgroenewald5711
@dewaldgroenewald5711 5 жыл бұрын
Hi Tim, I am still quite new to learning C# specifically. I see there are some haters, but don't mind them. I appreciate your videos for not having a strange or annoying accent and also appreciate the real life implementations and examples as well as access to the source code. I appreciate that you take the time to explain things in detail and calling them on their correct name (eg. lambda expression). I also do not feel that you rush sentences or have trouble with articulation. Opinions are like a-holes, everybody has one. And that is just the opinion of some a-hole. Your content is superb and I hope to soon be able to contribute and take some of your paying courses. Thanks for your hard work, which makes my life easier.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I appreciate the kind words.
@devvorpian7255
@devvorpian7255 Жыл бұрын
The best informative channel I've ever seen about programming... Thanks a lot sir!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@ronaldolds1034
@ronaldolds1034 3 жыл бұрын
I just found your channel when looking for blazor information. It was a great experience. Most all other tutorials tell you click here, do this, then this, but never tell you why. You tell me why certain things are done, which is great, it’s how I learn best. During the blazor tutorial, you used async, tasks and await. I wanted to know more and found this tutorial, it explains it perfectly for me and easy to wrap my head around. Thanks. I’ll be watching more of your tutorials as I have time.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks for the nice comments. I strive to educate, not just show examples. It does seem to be helping a lot of folks.
@ronaldolds1034
@ronaldolds1034 3 жыл бұрын
@@IAmTimCorey Do you have a video of setting up to allow login and restricting access to pages once you are logged on? This would also be in Blazor
@jaimecanoramos5207
@jaimecanoramos5207 3 жыл бұрын
Probably one of the best tutorials for async out there, if not the best. Really good job!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thank you!
@logix8969
@logix8969 5 жыл бұрын
I know this is unrelated but thank you for bringing that trick with the $ symbol with a string to my attention! That's seriously useful, since now I can clean up my code a little, get rid of all this "some string: " + someValue + ", some other string: " + someOtherValue crap. Also very nice explanation! I've yet to delve into asynchronous programming but I envisage this being extremely useful in my current project :)
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I am glad you got some value out of the video.
@kalvinwei19
@kalvinwei19 4 жыл бұрын
Thank you Tim. I was desperately looking for enlightenment of async on C#
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad it was helpful!
@Chapali9a
@Chapali9a 4 жыл бұрын
Wow! This is simply the best Async tutorial! I managed to completely understand it despite being a complete beginner! Thank you very much for providing such amazing stuff for free.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You're very welcome!
@samanson2001
@samanson2001 9 ай бұрын
Finally a video that explains some of the different applications of async. Never understood it previously as I just thought what's the difference if you're awaiting on things.
@IAmTimCorey
@IAmTimCorey 9 ай бұрын
I am glad it was helpful.
@MrLilleblomst
@MrLilleblomst 5 жыл бұрын
Excellent video. I'm fairly new to C# and found this video to be to the point, very easy to follow and the code to be highly readable. I learned a lot!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Great!
@napstericious
@napstericious 2 жыл бұрын
Straight to the point and easy to understand. You've got yourself another sub. Thank you for your time and effort put into this! :)
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks!
@MindBodyMeditate
@MindBodyMeditate 5 жыл бұрын
Dude, you're wicked. I always expect a video from that Indian guy but then you come through.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I'm assuming that's a good thing. :-)
@louisbroucke2990
@louisbroucke2990 4 жыл бұрын
Thank you Tim, cristal clear! Whenever I have a question during my course, I'll just search your channel, watch a video and BAM, question solved! Much appreciated!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad my content is so helpful.
@eltoncastrosousa
@eltoncastrosousa 5 жыл бұрын
Fantastic class. I've been studying this subject for a long time, but never found so clean and straightforward explanation. Congrats!!!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you!
@alexzinkevych3596
@alexzinkevych3596 4 жыл бұрын
Wow, this is pretty much like async/await and Promise in JS. The video was really easy to understand with that in mind.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Great!
@advaitharmy
@advaitharmy 4 жыл бұрын
You are brilliant in teaching sir 🙏🏼
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
So nice of you
@FranChen1984
@FranChen1984 Жыл бұрын
Your voice and English accent are good. Few of vedios that not hurt my ears!Thanks!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@trustingod0
@trustingod0 Жыл бұрын
Yeah great 🎤. By the way what model mic are you using I want to start making some tutorials
@halivudestevez2
@halivudestevez2 2 жыл бұрын
viewer: this video seems to be long, but it is worth to watch, teaching a lot, goes into details, you will know how it works, what to expect.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thank you!
@tomc2534
@tomc2534 5 жыл бұрын
This video cleared up so many misconceptions I had around async methods and how to use them. Fantastic!!! Keep doing what you are doing because it is working!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you!
@atnguyen5442
@atnguyen5442 5 жыл бұрын
Best channel to learn c#. Wish I known it earlier
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you!
@thebigmoon8372
@thebigmoon8372 2 жыл бұрын
I'm wondering... Why do i find this video only now??? Thank you so much. It was so easy to understand it with you
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I am glad you found it.
@kartikk7402
@kartikk7402 5 жыл бұрын
Best video on async await.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you!
@Octavius145
@Octavius145 3 жыл бұрын
I’ve now watched a two digit number of videos covering this topic because I wanted to calculate the async way. Thanks to you my journey is finally over. Fantastic video!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Glad it was helpful!
@branimirkobescak7769
@branimirkobescak7769 4 жыл бұрын
why are you so great? I come from C++ background. It was the language I grew up with and got used to programming being so difficult(and the community being so aggressive) but ever since my first programming job introduced me to C# I just kept getting amazed at how much friendly and easy C# is, both as in the community and the way it was developed, and you're part of what makes it great. I hope you don't stop making C# videos, any time soon, because a lot of times I just watch them because I like watching you explain things :)
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I appreciate the kind words. I am glad my content has been so helpful and encouraging.
@KyleWestendorf
@KyleWestendorf 6 жыл бұрын
This is so incredibly helpful. I absolutely love your teaching style. Thank you for this. If you don't already do Udemy courses, I think you should.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Thanks! I don't teach Udemy courses (for a number of reasons, mostly around control) but I do sell courses on my website ( IAmTimCorey.com ). If you join my mailing list, you will also hear about the new courses that are coming out and get exclusive discounts on said courses.
@KarChunChua
@KarChunChua 3 жыл бұрын
Great explanation and demo!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thank you!
@camrws
@camrws Жыл бұрын
what are the potential benefits of using the native async implementation of a method (download website in this case) instead of just wrapping the synchronous?
@bennysaa
@bennysaa Жыл бұрын
Really good question.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
There are a few. First, an async-native method can properly handle a cancellation token. That means you can cancel long-running tasks, stuck tasks, etc. You cannot do this with converted methods. Second, an async-native application knows how to interact with other resources while in another thread. Synchronous methods assume they are on the same thread as the UI so they may interact with the UI or other resources. That can cause threading issues.
@lastidea4925
@lastidea4925 2 жыл бұрын
Sir, you're the best. I've watched like 5-6 videos about that but couldn't understand when we have to use await when not etc. But all of them clear now. Thank you for teaching! ❤
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Awesome! I’m glad it clicked.
@przemosz7337
@przemosz7337 2 жыл бұрын
I was learning from documentation, but it wasn't as easy as I expected. I understand what async is because I have learned it in python, and all I wanted was to know how to create tasks, where to put async, how to run tasks list, etc. Finally, I found your video. Thanks dude, this is something I was looking for. Simple and straight to the point. Advanced async is going to be watched tomorrow :)
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Awesome! I am glad it was helpful.
@sashithafonseka
@sashithafonseka 2 жыл бұрын
Hey Tim, Thanks for the insightful video. A question here, could you explain a bit more on why returning void in an async method (except in an event) is considered a bad practice?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Because the method cannot communicate a failure to you.
@jonathanharmon3472
@jonathanharmon3472 2 жыл бұрын
To expand on what Tim said, if it's void, you don't have the Task object, which can contain any exceptions that might have occurred while awaiting the task.
@sashithafonseka
@sashithafonseka 2 жыл бұрын
@@jonathanharmon3472 and @IAmTimCorey thank you for the clarification!
@dand4485
@dand4485 5 жыл бұрын
Great explanation, what i found interesting from what it appeared to me the order of the results came back in the same order for the Sync and Async. Just a bit strange but i really doubt you're doing anything weird, sure you'd agree order shouldn't be deterministic but just happened this way by random chance. But this was great explanation and above all don't want my comment to take away from how good the video is, just an observation, guess that's why i'm a tester at heart :)
@dennisekkelenkamp2303
@dennisekkelenkamp2303 5 жыл бұрын
Do you mean in the 'parallel' method? The tasks could have finished in any order. But the result array will contain the results in the same order as the Task[]. (So, tasks[0].Result will be in results[0], tasks[1].Result in results[1], etc) That's why the foreach loop will always enumerate them in the same order.
@dand4485
@dand4485 5 жыл бұрын
@@dennisekkelenkamp2303 Ah perfect, i see my mistake, thanks for your kind response, thiink i see my mistake. The list will contain the items in order as how you added them... (duh, shouldn't watch these at 1am when i'm not thinking straight...) Think my erroneous thinking is a hold over to the old ways of treaing i.e. a thread pool and worker threads, that's me, wanting to over complicate it :) And that might be true under the covers in the state machine which .Net/C# is providing but we only have the reference to the object in the list Task, an they will be in "insertion order". Thank for the clarification perfectly clear now :) Have a GREAT DAY!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Nice job both of you. I'm glad to see you both contributing positively to the community. Thanks for watching.
@wildKawa
@wildKawa 2 жыл бұрын
Hmm... how would i go about adding a try/catch in the async function? Some of the listed websites sometimes send back an error - i added a try catch block to simply print "protocol error" in these cases, but in the async function that ends up crashing the program with "The calling thread cannot access this object because a different thread owns it." I assume that happens because my try/catch is in the WebsiteDataModel which isn't async itself? Cheers!
@siggimund
@siggimund Жыл бұрын
This is how I solved this: - Add property 'public string WebsiteStatus { get; set; } = "Ok";' to class 'WebsiteDataModel'. - When calling 'client.DownloadString/DownloadStringTaskAsync' 'catch' the 'WebException' and save 'webException.Status' (and maybe 'webException.Message') in 'output.WebsiteStatus' - Add 'data.WebsiteStatus' to the 'resultsWindow.Text' string in 'ReportWebsiteInfo()' to display it.
@charlesdodson829
@charlesdodson829 5 жыл бұрын
Thank you Mr. Corey. That was absolutely the best explanation I've heard concerning asynchronous programming. I have enjoyed your videos very much. Once again, "thank you".
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Awesome! I'm glad it was clear and enjoyable.
@danielsauter5326
@danielsauter5326 4 жыл бұрын
Really enjoyed the clear and concise explanation. I've seen asynchronous code many times but this really made things crystal clear
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I'm glad you enjoyed it.
@mekkanikmike
@mekkanikmike 2 жыл бұрын
Six months of frustration, 25 mins of tim corey (sorry I watch at 1.5x :D ...) to solve it.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I am glad it was so helpful.
@chadiusmaximus9350
@chadiusmaximus9350 3 жыл бұрын
Great video, you explain things very well. I think, however, your parallel method isn't actually running parallel rather its running concurrently.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
That is up to the system. It determines whether to run them concurrently or in parallel based upon how expensive it is to spin up a new thread vs how long it will take waiting on an existing resource.
@chadiusmaximus9350
@chadiusmaximus9350 3 жыл бұрын
@@IAmTimCorey ahh ok, I'm coming from Go where you have to write your code either concurrent or parallel. So you're saying the the .Net runtime handles that automatically? Rob Pike gives a really good talk on the subject.
@raus_mit_Islam
@raus_mit_Islam 3 жыл бұрын
I still am confused: does the calling thread wait or continue while await is working?!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
That particular method waits when you call "await" but it releases the thread back to the caller (usually the UI) to continue doing other work as long as that work doesn't depend on the results of the await.
@raus_mit_Islam
@raus_mit_Islam 3 жыл бұрын
@@IAmTimCorey Q1: the released thread will join other yet not used threads, thus decreasing the risk that the appl runs out of threads? Or, will it immediately be assigned to specific work? Q2: given that the await’ed flow (fx of reading a file or performing a HTTP request) is without a thread, what ressource does it have? Reading from a file still needs processor power and RAM I suppose.
@christopherkreitlow1178
@christopherkreitlow1178 5 жыл бұрын
A great, simple explanation of the fundamentals of a complex topic. Thanks!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are welcome.
@lukenukem8028
@lukenukem8028 4 жыл бұрын
I like you, especially because you answered my question: Q: If you're going to use await Task when why not just run it inline? A: It's about giving control back to the program.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Yep, that's important to understand.
@otkirbeksobirjonov9695
@otkirbeksobirjonov9695 3 жыл бұрын
Hi Tim Corey ! Thanks for this video Pleace !!! Can you make lessons about 'clean architecture with rest epi in .net 5' Step by step with Audentification and user admin roles ?
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks for the suggestion. While it isn't specifically "clean architecture" design, have you seen the TimCo series? In there, I set up a REST API in .NET 5 that uses Microsoft Identity (using Entity Framework) for authentication and authorization. Then I consume that API in both WPF and Blazor WebAssembly and make use of multiple custom roles.
@timkaiser3820
@timkaiser3820 3 жыл бұрын
Wichtig und richtig.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks!
@crabjuice47
@crabjuice47 3 жыл бұрын
Very complicated. Thanks for making it, I appreciate that but if you are new to async this won't work as a tutorial. I think starting from a blank code will be better.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
This basically was a "blank slate" project. The only things I did were to get a basic UI together so you didn't need to watch that and I created some basic code to call that was expensive. That "expensive" code can be anything you want and you don't even need to know what it does. The only way I could have done that with any less would be if I had built those two things on screen (but you would not have gotten anything else out of it since I explained both at the beginning), so it would have made the video longer but not added any real value to the topic.
@Printoiid
@Printoiid 3 жыл бұрын
@@IAmTimCorey I think you would have been better off explaining the logic before showing examples, actually.
@spaceengineersmods
@spaceengineersmods 3 жыл бұрын
Is it a good idea to measure time of the internet speed when wanne show the function of tasks
@slowdragon4169
@slowdragon4169 4 жыл бұрын
man what a legend you are. such a great guy, i can just feel the enormous care and passion that you put into making this tutorial. god bless you man. you sir are a legend. a true legend i tell you. what a guy. ooofffff. this world needs more people like you in it. (em not crying k?)
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I appreciate the kind words.
@midnightcigarettes8564
@midnightcigarettes8564 4 жыл бұрын
This is the only explanation that made me fully understand (and as clear as air) how async / await works. I got so frustrated sifting through blobs of texts on stackoverflow or some programming blog post where they delve away too much from the concept. Thank you, thank you very much sir. I really mean it, I will definitely buy your course sir. You are a fantastic teacher!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad it was so helpful.
@noodlecruncher5493
@noodlecruncher5493 4 жыл бұрын
@@IAmTimCorey I am glad you are active on these threads, you seem like an awesome guy, doing these videos for free, I would come to believe you Paid Courses are a much better and clearer understanding that would make someone a top tier coding in the real world!
@adiac42
@adiac42 2 жыл бұрын
This video about Async was legen... wait for it ...daryAsync!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
lol
@CrashCubeZeroOne
@CrashCubeZeroOne 2 жыл бұрын
One could say, await it
@nicolamarizza1521
@nicolamarizza1521 4 жыл бұрын
That moment while working on a project when you don't remember stuff and go straight to Tim Corey
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am glad my content is that helpful.
@Greviouss
@Greviouss 4 жыл бұрын
@@IAmTimCorey it is..
@devbackhome
@devbackhome 4 жыл бұрын
video starts at 2:23
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
That's the solution with out presenting the problem. Be careful of that.
@lyndondoliveiro5941
@lyndondoliveiro5941 4 жыл бұрын
Very well explained. This is not the first time Tim Corey has been very helpful
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thank you!
@soucianceeqdamrashti8175
@soucianceeqdamrashti8175 5 жыл бұрын
Really cool that you showed how to run things in parrallell as well and explained the difference. Best video I have seen on async!
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you!
@haydengalloway5177
@haydengalloway5177 2 жыл бұрын
13 minutes to explain the overly complicated demo program before even starting to talk about async.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Context is important, as is not leaving anyone behind. If you are unsure of the starting position, you won't be able to grasp where we go.
@haydengalloway5177
@haydengalloway5177 2 жыл бұрын
@@IAmTimCorey Also you didn't talk about one of the most important points of confusion about using async. The dreaded "A method was called at an unexpected time" exception.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You don't get that message if you follow my instructions. That message happens because you don't properly await a call.
@Antonio-lt1sp
@Antonio-lt1sp 2 жыл бұрын
@@IAmTimCorey I felt that the context explanation was very helpful. Thank you so much for the awesome work you do 🙏🙏🙏
@henriquejvalho
@henriquejvalho 6 жыл бұрын
Best explanation about Async / Await I've ever seen! Thank you.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Awesome!
@weizhen77
@weizhen77 5 жыл бұрын
I was stuck on how to synchronise my tasks executions. Thank you! After watching this video, all starts to make sense. Thank you very much for your step-by-step and concise explanations.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are most welcome. Thanks for watching.
@secretsquirrel5566
@secretsquirrel5566 4 жыл бұрын
For whatever reason, I've never been able to truly wrap my head around writting asynchronous methods and events. Those days are gone forever. Thank you Sir. I truly get it now and feel free for the first time. I REALLY appreciate your tutorial on this.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks for sharing!
@StultusRex
@StultusRex 5 жыл бұрын
A beginner in C#, been following your channel and videos for awhile now and this tutorial taught me how to improve/optimize my work. Thank you very much for toning it down to "elementary" level haha Seeing comments here that you messed up on delivering/discussing it, in my opinion, you did better than any professor I had. haha Looking forward on more ASP and C# topics. Thank you! :)
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I am glad it was so helpful.
@hectorhenry9841
@hectorhenry9841 4 жыл бұрын
THANK YOU Tim! This is such a clear explanation on Asynchronous. It blew me away! To think I've been programming most of my life linearly (except for a few multi-threading things I've done). I am a new fan of your series!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are most welcome. Thanks for watching.
@Ny_babs
@Ny_babs 4 жыл бұрын
I think this is the best video you’ve made. They are all great, this one is next level good.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I appreciate the kind words.
@Ny_babs
@Ny_babs 4 жыл бұрын
I do .net software dev for a company, and I watch a lot of videos on topics. Lots of people have different ways to complete tasks. It explains every step. We use .net c# for mostly report generation that is customized to client needs, where SSRS isn’t a great option. I will for sure be using async/ await from now on!
@david-xw4ug
@david-xw4ug Жыл бұрын
Can't believe I understood ever word in the video! Thank you for the excellent work!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@SuperChrisDub
@SuperChrisDub Жыл бұрын
Thank you so much. The only tutorial that made me understand properly, and I really like that fact that you explain that this is demo and not for production.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I am glad it was helpful.
@reynoldmonares179
@reynoldmonares179 4 жыл бұрын
Thank you so much Tim. These really helped me understand async await better than the other youtube videos. It really helped me.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Awesome!
@khdvid801
@khdvid801 5 жыл бұрын
Sir Timcorey, I love your teaching technic. Your every lessons help me to understand very easily. Thank you million time. I am from Manipur, I believe you share your valuable knowledge whole over world. Long live sir.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
I appreciate the kind words.
@mikebreeden6071
@mikebreeden6071 4 жыл бұрын
I'm having to "learn" a new project at work and a lot of it is new technology and a new style for me... I can tell that the developer that wrote it learned a lot of it from your videos. This helps a lot.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Great!
@david3552
@david3552 2 жыл бұрын
You and your videos are fantastic. Learning async using the offical documentation felt kind of daunting and convoluted. You made it clear!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I appreciate the kind words.
@ghosttactic9508
@ghosttactic9508 4 жыл бұрын
Your making programming easy to learn, I've been programming c# for a year so not much knowledge. But the knowledge i do have is because of your explanations!! Awsome video. Thank you
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Great to hear! Stick with it.
@walius1988
@walius1988 3 жыл бұрын
Because of your videos, I am getting better and better in C#. Thank you a lot!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You are welcome.
@ArbenBisha
@ArbenBisha Жыл бұрын
You are an amazing teacher. I do programming as a side hobby, and for years had avoided dealing with async methods because I couldn't understand them retorting to the old backgroundworker instead. I watched this video and understood what I needed to do and bam, first I changed my code to make it asynchronous, and then to make it work in parallel. I'm looking forward to watching the next video about the progress reports, hope I understand and implement that one as well.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I am glad it was so helpful.
@zacnetic3103
@zacnetic3103 5 жыл бұрын
It has literally just become a habit to like these videos before they even begin lol. Great work explaining this.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Thank you!
Delegates in C# - A practical demonstration, including Action and Func
1:09:11
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
That's NOT How Async And Await Works in .NET!
12:25
Codewrinkles
Рет қаралды 27 М.
What are ASYNC and AWAIT in C#? Asynchronous Programming Tutorial
18:34
Settling the Biggest Await Async Debate in .NET
14:47
Nick Chapsas
Рет қаралды 148 М.
C# Async Programming - Part 1: Conceptual Background
29:49
Rainer Stropek
Рет қаралды 67 М.