I'm new to the Polly for building the retry policy and what I noticed that is, Polly will execute the same method over and over again if it meets specific exception. However, is it possible that Polly could retry with different method recursively? Here is one example of my current work flow:
- I have a list of items to write into database as a batch operation, but I don't know the total data size of my list.
- My database writing operation would have a limitation of certain size, say its max size of 2 MB.
- Suppose my input list contains 5,000 items, then when it exceed my database write operation limitation, throws an exception. What I'd like to do is to divide the 5000 items into half as 2 subsets with each of 2,500 items. Then try to write with those two subset again...
- If my two subset of 2,500 items still exceed the limitation, I will divide the 2500 into half as 2 subsets with each of 1,250 items, then try same thing again.
So basically my retry-policy will be executed based on recursive way, when meet an exception, split dataset and retry, and going on...However, with Polly I can't find a way to call my execution method recursively...