async void – How to Tame the Asynchronous Nightmare

You're an intermediate dotnet programmer and you mostly know your way around using Tasks. You sprinkle async and await through your code, and everything is working just as expected. You've heard time and time again that you always want the return types of your asynchronous methods to be a Task (or Task<T>) and that async void is essentially the root of all evil. No sweat. One day you go to wire up an event handler using the syntax myObject.SomeEvent += SomeEventHandler, and your event handler needs to await some asynchronous code. You take all of the right steps and change your method signature to get that beautiful async Task added in, replacing void. But suddenly you get a compile error about your event handler not being compatible. You feel trapped. You're scared. And then you do the unspeakable... You change…


C# Dev Connect 1 – Intro To Threading

C# Dev Connect 1: Intro to Threading In my last post, I mentioned we'd be hosting a C# Dev Connect meetup at our Magnet Forensics HQ in Waterloo. I figured I'd post to talk about how the event went so that if you couldn't make it, you'll have an idea for next time (and if you did make it, maybe you can comment on how you thought the event went). Our first Dev Connect was lead by a colleague of mine, Chris Sippel, who wanted to give a talk on threading basics in C#. Threading can quickly become a really complex topic, so Chris wanted to keep it high level and talk about the different approaches you can use to start threading in your C# applications. Dev Connect: Before the Talk Before Chris gave his talk on threading, we…


End of content

No more pages to load