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);
}
Aggregations