You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#506.
When asking the retry policy to decide the next step, pass the result of
the last attempt. Depending on the combinator, this could be a value or
an error.
Before:
```scala
case class RetryPolicy[F[_]](
decideNextRetry: RetryStatus => F[PolicyDecision]
)
```
After:
```scala
case class RetryPolicy[F[_], -Res](
decideNextRetry: (Res, RetryStatus) => F[PolicyDecision]
)
```
This allows users to implement more exotic retry policies, e.g. choosing
to retry some kinds of error quickly, but using exponential backoff for
others. I've added `RetryPolicies.dynamic` to support that.
All the built-in policies maintain their existing behaviour: they ignore
the action result and decide the next step based on static rules.
This was quite a noisy change because it involved adding a new type
parameter to `RetryPolicy`.
We have use case where we want to retry some errors immediately, other errors cause a regular exponential backoff.
Is there currently a way to do this with cats-retry? If not, could this feature be added?
The text was updated successfully, but these errors were encountered: