Batch

Handles a batch of PendingResult
items. Callbacks can be added and you can block to wait for all items in the batch to
complete like any other PendingResult
item. A Batch can also be canceled if the results are no longer needed. In this case, the
onBatchComplete callback will never be triggered.

Blocks until the task is completed or has timed out waiting for the result. This is
not allowed on the UI thread. The returned result object can have an additional failure
mode of either
INTERRUPTED or TIMEOUT.

public voidcancel()

Requests that the batch be canceled. Cancels all underlying
PendingResults.

Set the callback here if you want the result to be delivered via a callback when the
result is ready or has timed out waiting for the result. The returned result object can
have an additional failure mode of TIMEOUT.