ExecutorDeliverypublic class ExecutorDelivery extends Object implements ResponseDeliveryDelivers responses and errors. |
Fields Summary |
---|
private final Executor | mResponsePosterUsed for posting responses, typically to the main thread. |
Constructors Summary |
---|
public ExecutorDelivery(android.os.Handler handler)Creates a new response delivery interface.
// Make an Executor that just wraps the handler.
mResponsePoster = new Executor() {
@Override
public void execute(Runnable command) {
handler.post(command);
}
};
| public ExecutorDelivery(Executor executor)Creates a new response delivery interface, mockable version
for testing.
mResponsePoster = executor;
|
Methods Summary |
---|
public void | postError(Request request, VolleyError error)
request.addMarker("post-error");
Response<?> response = Response.error(error);
mResponsePoster.execute(new ResponseDeliveryRunnable(request, response, null));
| public void | postResponse(Request request, Response response)
postResponse(request, response, null);
| public void | postResponse(Request request, Response response, java.lang.Runnable runnable)
request.markDelivered();
request.addMarker("post-response");
mResponsePoster.execute(new ResponseDeliveryRunnable(request, response, runnable));
|
|