public class LinearBackoff extends java.lang.Object implements BackoffPolicy
Modifier and Type | Field and Description |
---|---|
protected long |
_backoff |
Constructor and Description |
---|
LinearBackoff(long backoff)
A policy that increases the backoff duration by the same amount after every retry.
|
Modifier and Type | Method and Description |
---|---|
long |
nextBackoff(int attempts,
java.lang.Throwable error)
Computes the next backoff duration using the specified number of attempts and the error that caused the
operation to consider another attempt.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
constant, exponential, fibonacci, linear, noBackoff, randomized, selected
public LinearBackoff(long backoff)
backoff
- The backoff used for the first retry as well as the base for all subsequent attempts.public long nextBackoff(int attempts, java.lang.Throwable error)
nextBackoff
in interface BackoffPolicy
attempts
- The number of attempts that have been made so far.error
- The error that caused the operation to consider another attempt.