guava-retrying icon indicating copy to clipboard operation
guava-retrying copied to clipboard

`RetryListener`s are not only called on retry

Open JensRantil opened this issue 10 years ago • 3 comments

Annoyance: This is a small annoyance; A RetryListener is not only called on a retry. It is called on each attempt. That includes the first call.

Proposed fix: Rename

  • RetryListener to AttemptListener.
  • RetryerBuilder#withRetryListener to RetryerBuilder#withAttemptListener.

I understand that this will introduce backward incompatible change. I therefor propose this is a fix introduced for the next major version.

JensRantil avatar Aug 24 '15 14:08 JensRantil

this really threw me off. came to file an issue, found this. strongly agree. this is an error, because the semantic name does not match the described behavior.

cdaringe avatar Mar 30 '16 06:03 cdaringe

+1 found this same problem myself today. in it's current form it feels more like a plain old listener rather than specifically a retry Listener (https://github.com/rholder/guava-retrying/blob/master/src/main/java/com/github/rholder/retry/Retryer.java#L166)

techwhizbang avatar Mar 16 '18 00:03 techwhizbang

+1 Any plans on resolving this?

dev3loperb avatar Apr 23 '18 08:04 dev3loperb