Given a number of retries, return how long to wait till the next retry.
Given a number of retries, return how long to wait till the next retry. Note that this is
zero-indexed. To implement a finite number of retries, implement a method like:
if (i > 3) return never
Given a value, decide whether it is retryable.
Given a value, decide whether it is retryable. Typically the value is an exception.
A convenience method to access Duration.
A convenience method to access Duration.forever from Java. This is a sentinel value that signals no-further-retries.
A retry policy abstract class. This is convenient to use for Java programmers. Simply implement the two abstract methods
shouldRetry
andbackoffAt
and you're good to go!