cats-retry icon indicating copy to clipboard operation
cats-retry copied to clipboard

Rework limitRetries to possible infinite retries

Open Ssstlis opened this issue 4 years ago • 2 comments

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.

Ssstlis avatar Mar 30 '20 17:03 Ssstlis

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.

cb372 avatar Mar 31 '20 10:03 cb372

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?

Ssstlis avatar Mar 31 '20 11:03 Ssstlis