T
- the type of the result object.public interface PendingResult<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
PendingResult.Callback<T>
The callback interface the API client code needs to implement to handle API results.
|
Modifier and Type | Method and Description |
---|---|
T |
await()
Performs the request synchronously.
|
T |
awaitIgnoreError()
Performs the request synchronously, ignoring exceptions while performing the request and errors
returned by the server.
|
void |
cancel()
Attempts to cancel the request.
|
void |
setCallback(PendingResult.Callback<T> callback)
|
void setCallback(PendingResult.Callback<T> callback)
onResult
or onFailure
after the request has been
completed.callback
- The callback to call on completion.T await() throws ApiException, java.lang.InterruptedException, java.io.IOException
ApiException
- Thrown if the API Returned result is an error.java.lang.InterruptedException
- Thrown when a thread is waiting, sleeping, or otherwise occupied,
and the thread is interrupted.java.io.IOException
- Thrown when an I/O exception of some sort has occurred.T awaitIgnoreError()
void cancel()