Add side-effecting callback to retry attempts
rucek opened this issue · comments
Jacek Kunicki commented
When the retry mechanism performs another attempt to run the operation, it might be useful to execute a side effect - like logging or updating metrics.
Some things to consider:
- how much context should such a callback have (e.g. which attempt is this)
- should the callback be executed before or after the attempt? In the latter case it could include the result, which - particularly in case of error - might be useful for logging/metrics. Or perhaps both such callbacks should be available, so that we can hook into the retry lifecycle even more?