Closed JayBazuzi closed 2 years ago
RetryPolicy.withBackoff() currently takes two long and a shared unit, which makes it awkward when the two values are far apart from each other:
RetryPolicy.withBackoff()
long
new RetryPolicy<>() .withDuration(1, 300000 /* 5 minutes, I think */), ChronoUnit.MILLIS));
I wish I could write:
new RetryPolicy<>() .withDelay(Duration.ofMillis(1) .withMaxDelay(Duration.ofMinutes(5));
or
new RetryPolicy<>() .withBackoff(Duration.ofMillis(1), Duration.ofMinutes(5));
Good suggestion. withBackoff(Duration, Duration) seems worth supporting and possibly withMaxDuration as well.
withBackoff(Duration, Duration)
withMaxDuration
3.0 has been released, which includes this improvement.
RetryPolicy.withBackoff()
currently takes twolong
and a shared unit, which makes it awkward when the two values are far apart from each other:I wish I could write:
or