Retry With the .NET Task Parallel Library (TPL)
The .NET Task Parallel Library simplifies development of and reasoning about asynchronous code. However, working with Task instances instead of blocking method results can still be difficult and un-intuitive. One example where this is true is in implementing retry logic for functions that return Task instances. Consider this helper function which retries a provided function a specified number of times:
Read on →