Readable and testable asynchronous execution

Andreas Hallberg

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 [...]

Tags: , , ,