Комментарии:
why aren't you using concurrent collections in the parallel.Foreach ? you l=might get errors using lists no ? you might even get wrong progress reports.
ОтветитьIn addition to this, there's now a Parallel.ForEachAsync in .NET 6 and newer.
ОтветитьI just signed up for your news letter, thanks. I noticed in this lesson on advanced async that 3 of the 10 test url's cause a redirect error "Too many redirects etc..." If you remove the microsoft, twitter and stack overflow url's the error goes away. I assume that these 3 sites have changed in some way over the years. If I want to include them do I need to add something in order for these to work again? Thanks again.
ОтветитьThanks a lot!!
Ответить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.
Hi, thanks for the great videos I really learnt a lot. I was wondering if you have any video where you talk about the configureawait method.
Ответить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.
ОтветитьIt is so helpful
Ответить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.
ОтветитьI am working on some async code communicating with hardware. I am having some trouble with returning when the task has been completed. I am using Task<bool> for each method. I have an await Task.WhenAll(task1, task2, task4). I have a task3 that should execute and complete before task4. Could you please help me identify the best practice and what I am doing wrong?
ОтветитьMuchas gracias Tim. Que hermosa explicación!
ОтветитьWhat about CancellationTokenSource once it was first cancelled and app is still running and I want to perform operation again? At current state when I order operation second time it gets cancelled immadiately as the token is set to "cancel". What is the convention to "uncancel" it? I was looking for some method to do it and couldn't find it, so I created new CTS instance at the end of the method and it works. The question is -> is it a proper way to create new instance of CTS for next operations or maybe I can uncancel CTS in some "proper" way?
Btw. Great Video! Big Thanks :D
Thanks a lot for another great video.
ОтветитьI placed the cts.ThrowIfCancellationRequested(); statement before the await DownloadWebsiteAsync instead of after it. The behavior changed. The "download cancelled" message was never written to the output.
Ответить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.
Ответить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!
ОтветитьHello Tim, thanks for the awesome content, learned a lot from this video. However I did find a bug in your code, and that is, once you hit the Cancel button once to stop the downloading process, the subsequent DownloadAsync button no longer works properly. The problem is that you didn't reinitialize the cts variable, so the IsCancellationRequested remains true. I worked around this by reinialize cts every time DownloadAsync button is clicked. Not sure whether my idea is right, and whether this work around is the best practice, please inform me some more, thanks a lot!
ОтветитьHi, thans alot for maintaining this awesome c# channel. I've learned alot alot from you.
Question, when you name the class "ProgressReportModel", what does the word "Model" mean in this context?
I want to learn how to name my clas clear and precise, but I dont quite understand the use case of the word Model in this context.
Does it mean that everytime I want to make a data container class I shall name it xxxModel ?
Should you lock the progress report within the parallel for each to prevent race issues?
Ответить