com.duowan.mobile.netroid
Interface RetryPolicy

All Known Implementing Classes:
DefaultRetryPolicy

public interface RetryPolicy

Retry policy for a request.


Method Summary
 int getCurrentRetryCount()
          Returns the current retry count (used for logging).
 int getCurrentTimeout()
          Returns the current timeout (used for logging).
 void retry(NetroidError error)
          Prepares for the next retry by applying a backoff to the timeout.
 

Method Detail

getCurrentTimeout

int getCurrentTimeout()
Returns the current timeout (used for logging).


getCurrentRetryCount

int getCurrentRetryCount()
Returns the current retry count (used for logging).


retry

void retry(NetroidError error)
           throws NetroidError
Prepares for the next retry by applying a backoff to the timeout.

Parameters:
error - The error code of the last attempt.
Throws:
NetroidError - In the event that the retry could not be performed (for example if we ran out of attempts), the passed in error is thrown.