Interface RetryingExecutor<ResponseT> (2.46.1)

publicinterface RetryingExecutor<ResponseT>

A retrying executor is responsible for the following operations:

  1. Creating first attempt RetryingFuture, which acts as a facade, hiding from client code the actual execution of scheduled retry attempts.
  2. Executing the actual Callable in a retriable context.

This interface is for internal/advanced use only.

Type Parameter

Name Description
ResponseT

Methods

createFuture(Callable<ResponseT> callable)

publicabstractRetryingFuture<ResponseT>createFuture(Callable<ResponseT>callable)

Creates the RetryingFuture, which is a facade, returned to the client code to wait for any retriable operation to complete.

Parameter
Name Description
callable Callable<ResponseT>

the actual callable, which should be executed in a retriable context

Returns
Type Description
RetryingFuture<ResponseT>

retrying future facade

submit(RetryingFuture<ResponseT> retryingFuture)

publicabstractApiFuture<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.

Parameter
Name Description
retryingFuture RetryingFuture<ResponseT>

the future previously returned by #createFuture(Callable) and reused for each subsequent attempt of same operation.

Returns
Type Description
ApiFuture<ResponseT>

submitted attempt future

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.