The Easiest Way To Write Async Code – Reading #FunnelWeblog Code

This one is a Back-To-Basics style post. Last month, I was checking some code for the relatively new .NET open source blog engine, FunnelWeb, and noticed this bit of code:

funnelwebsrcFunnelWeb.Extensions.CommentNotificationCommentPostedListener.cs

ThreadPool.QueueUserWorkItem(
    delegate
        {
            SendEmail(settings, commentDetails);
        });

This is just a real easy way to make async call, right?

 

BTW, you can learn more about the ThreadPool.QueueUserWorkItem() method from MSDN here.

 

More Interesting Stuff

Playing with it after reading, I found that Matt Valerio seems to have very interesting takes on this method, making you use it in many elegant ways:

 

I highly recommend the first two articles especially, the code is really elegant.

 

What IS This Post???

I felt a strong desire to blog something before I go to work today and wanted to see if that’s possible.

Not sure if I should write more posts like this, or am I then converting the blog here to a micro-blog/twitter/tumblr of some kind.

You might help me by telling what you think in the comments.

Share With Friends:

How did I learn that?

As a bonus for coming here, I'm giving away a free newsletter for web developers that you can sign up for from here.

It's not an anything-and-everything link list. It's thoughtfully collected picks of articles and tools, that focus on Angular 2+, ASP.NET (4.x/MVC5 and Core), and other fullstack developer goodies.

Take it for a test ride, and you may unsubscribe any time.

You might also want to support me by checking these out [Thanks]: