Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flesh out RetryPolicy's Javadoc. #194

Merged
merged 1 commit into from
May 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/main/java/com/android/volley/RetryPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,27 @@

package com.android.volley;

/** Retry policy for a request. */
/**
* Retry policy for a request.
*
* <p>A retry policy can control two parameters:
*
* <ul>
* <li>The number of tries. This can be a simple counter or more complex logic based on the type
* of error passed to {@link #retry(VolleyError)}, although {@link #getCurrentRetryCount()}
* should always return the current retry count for logging purposes.
* <li>The request timeout for each try, via {@link #getCurrentTimeout()}. In the common case that
* a request times out before the response has been received from the server, retrying again
* with a longer timeout can increase the likelihood of success (at the expense of causing the
* user to wait longer, especially if the request still fails).
* </ul>
*
* <p>Note that currently, retries triggered by a retry policy are attempted immediately in sequence
* with no delay between them (although the time between tries may increase if the requests are
* timing out and {@link #getCurrentTimeout()} is returning increasing values).
*
* <p>By default, Volley uses {@link DefaultRetryPolicy}.
*/
public interface RetryPolicy {

/** Returns the current timeout (used for logging). */
Expand Down