Implementing a simple retry pattern in c#