Executing code asynchronously in C# gives you at least two headaches: the code becomes hard to read and a pain to unit test. Here’s one way to alleviate these pains, using a configurable singleton aptly named “Async”: Async.Execute(() => { // … Console.WriteLine(“We’re running this on a background thread”); // … etc }); That’s the [...]
Readable and testable asynchronous execution
May 27th, 2010 by Andreas Hallberg — .Net, Tips & Tricks
Tags: .Net, async, asynchronous, C#
