|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BackoffPolicy
Policy class for determining how long to wait before retrying an HTTP request.
Field Summary | |
---|---|
static BackoffPolicy |
DEFAULT
Default backoff policy with a factor of 2, starting at 500ms and getting capped at 64000ms. |
static long |
STOP
Value indicating that no more retries should be made, getNextBackoffMs() . |
Method Summary | |
---|---|
long |
getNextBackoffMs()
Gets the number of milliseconds to wait before retrying an HTTP request. |
void |
reset()
Resets the policy to begin from its initial state. |
Field Detail |
---|
static final BackoffPolicy DEFAULT
static final long STOP
getNextBackoffMs()
.
Method Detail |
---|
long getNextBackoffMs()
STOP
is returned, no retries should be made.
This method should be used as follows:
long backoffTime = backoffPolicy.getNextBackoffMs(); if (backoffTime = BackoffPolicy.STOP) { // Stop retrying. } else { // Retry after backoffTime. }
STOP
if no more retries should be madevoid reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |