An alternative to
retryWhen(). This takes a lambda expression that
is passed the exception along with the number of times we have retried the
Flow so far. If the lambda expression returns
true, we retry the
again. If the lambda expression returns
false, the exception continues along
The lambda expression might look at the exception and choose different rules based upon details of the exception (e.g., exception type).