public interface ResponseFuture<Response> extends Cancelable
Modifier and Type | Method and Description |
---|---|
default boolean |
cancel()
Cancels it.
|
Response |
getResponse()
Waits for the response to arrive and returns it.
|
void |
registerListener(ResponseListener<Response> listener)
Registers a
ResponseListener to get called when the response arrives. |
void |
registerListener(ResponseListener<Response> listener,
Executor executor)
Registers a
ResponseListener to get called when the response arrives. |
void |
registerListener(ResponseListener<Response> listener,
Handler handler)
Registers a
ResponseListener to get called when the response arrives. |
Response getResponse() throws ResponseException
ResponseException
void registerListener(ResponseListener<Response> listener)
ResponseListener
to get called when the response arrives.
The listener will be called on the looper of the calling thread (it must have one for
this to work).void registerListener(ResponseListener<Response> listener, Handler handler)
ResponseListener
to get called when the response arrives.
The listener will be called via the given Handler
.void registerListener(ResponseListener<Response> listener, Executor executor)
ResponseListener
to get called when the response arrives.
The listener will be called via the given Executor
.default boolean cancel()
Cancelable
cancel
in interface Cancelable