Polly Introductions

Parrot flying with Eagles

Photo by Alexandre Debiève on Unsplash

Having seen mention of Polly on Scott Hanselmann’s blog and heard Dylan Reisenberger enthusiastically talk about it on  .Net Rocks, I was keen to have a look at this library and see what it can do.

Any type of integration relies on an IO operation that often out of control of the developer, we use web services that can go down, open and read files from remote servers that can be suddenly inaccessible, rely on database connections that can drop. Adding code to deal with this has always been essential to any integration module.

As an example I have created small console application that opens and reads an excel file, that is already open causing an IOException. I will add the Polly library to this and set up a policy to retry the operation while prompting the user to close the file.

Continue reading →