public abstract class Executor extends Object
NOTE: This can be used to intercept or mock all "execute" requests.
Modifier and Type | Class and Description |
---|---|
static class |
Executor.Default
A default, failure-tolerant implementation of the
Executor class. |
Constructor and Description |
---|
Executor() |
Modifier and Type | Method and Description |
---|---|
<T> T |
execute(com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest<T> request)
Executes the request, returning a response of the appropriate type.
|
abstract <T> T |
execute(RequestCallable<T> request)
Executes the request, returning a response of the appropriate type.
|
void |
sleep()
Surface this as a canonical means by which to sleep, so that clients can layer their own retry
logic on top of the executor using the same sleep facility;
|
void |
sleep(int retryAttempt)
Surface this as a canonical means by which to sleep, so that clients can layer their own retry
logic on top of the executor using the same sleep facility;
|
public <T> T execute(com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest<T> request) throws IOException, ExecutorException
T
- The type of the expected responserequest
- The request we are issuingIOException
- if anything goes wrongExecutorException
public abstract <T> T execute(RequestCallable<T> request) throws IOException, ExecutorException
T
- The type of the expected responserequest
- The request we are issuingIOException
- if anything goes wrongExecutorException
public void sleep()
public void sleep(int retryAttempt)
retryAttempt
- indicates how many times we had retried, to allow for increasing back-off
time.Copyright © 2016–2021. All rights reserved.