cats-retry
cats-retry copied to clipboard
Rework limitRetries to possible infinite retries
Also similar to akka i wanna have retry policy with infinite retries, based on arg maxRetries = -1
If you don't mind i can draft a PR and deprecate old version.
The default behaviour of the other built-in retry policies is to do infinite retries. limitRetries
is used specifically to prevent that behaviour.
e.g. constantDelay(100.milliseconds)
will keep retrying forever, but constantDelay(100.milliseconds) join limitRetries(5)
will only retry 5 times.
So I don't think a version of limitRetries
that does not limit retries would be helpful.
Does that make sense? Maybe the docs could be improved to explain this better.
Okay, it seems like i can use constantDelay(Duration.Zero) join ....
for reproduce the infinite retries but in case of finite number of retries i should write this: limitRetries(n) join ....
don't you think this isn't consistent?