Task EventHandlers – The Little Secret You Didn’t Know
If you're writing asynchronous code in C# and using EventHandlers, odds are you've had issues with exceptions. Task EventHandlers might be consideration!
If you're writing asynchronous code in C# and using EventHandlers, odds are you've had issues with exceptions. Task EventHandlers might be consideration!
Most intermediate dotnet devs writing async await code in C# will come across async void at some point. Here's a creative solution for avoiding the headaches.
(This article is intended to be a spiritual successor to this previous entry, and now includes Tasks!) Even if you're new to C#, you've probably come across at least one of Tasks, Threads, or BackgroundWorkers. With a bit of additional time, it's likely you've seen all three in your journey. They're all ways to run concurrent code in C# and each has its own set of pros and cons. In this article, we will explore how each one operates at a high level. It's worth noting that in most modern .NET applications and libraries you'll see things converging to Tasks. The Approach I've gone ahead and created a test application that you can find here. Because this is in source control, it's possible/likely that it will diverge from what we see in this article, so I just wanted to offer…
Your New Job Title Congrats! You did it! You finally have that new job title you've been working so hard towards! Let's be honest with each other here--you were working hard for the title, not because you just wanted to see your company flourish with all the hard work you were putting in. Of course that wasn't bad or anything, it was just a nice side effect of you getting your new job title. Some great things happened once you received your new job title too! Your responsibilities shifted so now nobody can come after you when your pesky clients are complaining about your sales process, when your code won't compile into your finished product, or when employees are having conflicts in the workplace. You're literally only responsible for the two new tasks that you have attached to your job…