T
- The type of request factory to generate new requests for each retry.public abstract class RequestManager<T extends RequestManager.RequestFactory>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
RequestManager.RequestFactory |
Modifier and Type | Field and Description |
---|---|
protected BackoffPolicy |
mBackoffPolicy |
protected com.mopub.volley.Request<?> |
mCurrentRequest |
protected android.os.Handler |
mHandler |
protected T |
mRequestFactory |
Constructor and Description |
---|
RequestManager(android.os.Looper looper) |
Modifier and Type | Method and Description |
---|---|
void |
cancelRequest()
Cancels the request in flight.
|
boolean |
isAtCapacity() |
void |
makeRequest(T requestFactory,
BackoffPolicy backoffPolicy)
This method first cancels existing requests in flight and then begins the request
lifecycle for the new request.
|
@Nullable protected com.mopub.volley.Request<?> mCurrentRequest
@Nullable protected T extends RequestManager.RequestFactory mRequestFactory
@Nullable protected BackoffPolicy mBackoffPolicy
@NonNull protected android.os.Handler mHandler
public boolean isAtCapacity()
public void makeRequest(@NonNull T requestFactory, @NonNull BackoffPolicy backoffPolicy)
requestFactory
- Factory that constructs a new request for each request retry from the
backoff policy.backoffPolicy
- The request to cancel.public void cancelRequest()