Open gm2211 opened 5 years ago
The challenge with either of these solutions is that Failsafe treats Policies a bit generically and allows arbitrarily nesting/combining policies, which could include multiple retry policies:
RetryPolicy<Connection> rp1 = ...
RetryPolicy<Connection> rp2 = ...
Fallback<Connection> fallback = ...
Failsafe.with(fallback, rp2, rp1).get(this:connect);
Perhaps we could collect all of the policies that considered the current attempt a failure prior to the fallback attempt, and make those available via the ExecutionAttemptedEvent
?
Currently there isn't a good way to return a result if the retry count is exceeded - this is the best I've found:
But I would prefer either:
or, even better, something like