Package com.google.api.gax.retrying
Interface RetryingExecutor<ResponseT>
-
- Type Parameters:
ResponseT- response type
- All Known Subinterfaces:
RetryingExecutorWithContext<ResponseT>
- All Known Implementing Classes:
DirectRetryingExecutor,ScheduledRetryingExecutor
public interface RetryingExecutor<ResponseT>A retrying executor is responsible for the following operations:- Creating first attempt
RetryingFuture, which acts as a facade, hiding from client code the actual execution of scheduled retry attempts. - Executing the actual
Callablein a retriable context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RetryingFuture<ResponseT>createFuture(Callable<ResponseT> callable)Creates theRetryingFuture, which is a facade, returned to the client code to wait for any retriable operation to complete.ApiFuture<ResponseT>submit(RetryingFuture<ResponseT> retryingFuture)Submits an attempt for execution.
-
-
-
Method Detail
-
createFuture
RetryingFuture<ResponseT> createFuture(Callable<ResponseT> callable)
Creates theRetryingFuture, which is a facade, returned to the client code to wait for any retriable operation to complete.- Parameters:
callable- the actual callable, which should be executed in a retriable context- Returns:
- retrying future facade
-
submit
ApiFuture<ResponseT> submit(RetryingFuture<ResponseT> retryingFuture)
Submits an attempt for execution. A typical implementation will either try to execute the attempt in the current thread or schedule it for an execution, using some sort of async execution service.- Parameters:
retryingFuture- the future previously returned bycreateFuture(Callable)and reused for each subsequent attempt of same operation.- Returns:
- submitted attempt future
-
-