So I started reading about Paramore Brighter CommandProcessor, didn’t get far and started reading about the packages it uses. This called out Polly (github) this project takes the voodoo out of writing retry handling. In the past I’ve raised comments on .NET discussions expressing my desire for this to be built directly into the BCL. That never really seemed to go anywhere.
michael-wolfenden really seemed to face the same dilemma and decided to roll his own. I haven’t used it yet, but from reading the markdown readme it has a beautiful fluent interface. I will definitely be using this in the future. Some usage examples:
// Retry multiple times, calling an action on each retry // with the current exception, retry count and context // provided to Execute() Policy .Handle<DivideByZeroException>() .Retry(3, (exception, retryCount, context) => { // do something });
Just awesome.
I have written blog on the same topic here https://neelbhatt40.wordpress.com/2015/01/19/polly-a-latest-nuget-package-for-exception-handling/
[…] i am now using Polly in production and it works awesomely. I followed the same fault handling policy noted on […]