Search in sources :

Example 1 with OperationResponsePollAlgorithm

use of com.google.api.gax.longrunning.OperationResponsePollAlgorithm in project gax-java by googleapis.

the class Callables method longRunningOperationImpl.

static <RequestT, ResponseT, MetadataT> OperationCallableImpl<RequestT, ResponseT, MetadataT> longRunningOperationImpl(UnaryCallable<RequestT, OperationSnapshot> initialCallable, OperationCallSettings<RequestT, ResponseT, MetadataT> operationCallSettings, ClientContext clientContext, LongRunningClient longRunningClient) {
    RetryAlgorithm<OperationSnapshot> pollingAlgorithm = new RetryAlgorithm<>(new OperationResponsePollAlgorithm(), operationCallSettings.getPollingAlgorithm());
    ScheduledRetryingExecutor<OperationSnapshot> scheduler = new ScheduledRetryingExecutor<>(pollingAlgorithm, clientContext.getExecutor());
    return new OperationCallableImpl<>(initialCallable, scheduler, longRunningClient, operationCallSettings);
}
Also used : ScheduledRetryingExecutor(com.google.api.gax.retrying.ScheduledRetryingExecutor) OperationResponsePollAlgorithm(com.google.api.gax.longrunning.OperationResponsePollAlgorithm) OperationSnapshot(com.google.api.gax.longrunning.OperationSnapshot) StreamingRetryAlgorithm(com.google.api.gax.retrying.StreamingRetryAlgorithm) RetryAlgorithm(com.google.api.gax.retrying.RetryAlgorithm) ExponentialRetryAlgorithm(com.google.api.gax.retrying.ExponentialRetryAlgorithm)

Aggregations

OperationResponsePollAlgorithm (com.google.api.gax.longrunning.OperationResponsePollAlgorithm)1 OperationSnapshot (com.google.api.gax.longrunning.OperationSnapshot)1 ExponentialRetryAlgorithm (com.google.api.gax.retrying.ExponentialRetryAlgorithm)1 RetryAlgorithm (com.google.api.gax.retrying.RetryAlgorithm)1 ScheduledRetryingExecutor (com.google.api.gax.retrying.ScheduledRetryingExecutor)1 StreamingRetryAlgorithm (com.google.api.gax.retrying.StreamingRetryAlgorithm)1