Codota Logo
ApiCallContext.withTimeout
Code IndexAdd Codota to your IDE (free)

How to use
withTimeout
method
in
com.google.api.gax.rpc.ApiCallContext

Best Java code snippets using com.google.api.gax.rpc.ApiCallContext.withTimeout (Showing top 8 results out of 315)

  • Common ways to obtain ApiCallContext
private void myMethod () {
ApiCallContext a =
  • Codota IconApiCallContext apiCallContext;ApiCallContext inputContext;apiCallContext.nullToSelf(inputContext)
  • Smart code suggestions by Codota
}
origin: googleapis/google-cloud-java

if (!externalFuture.getAttemptSettings().getRpcTimeout().isZero()) {
 currentCallContext =
   currentCallContext.withTimeout(externalFuture.getAttemptSettings().getRpcTimeout());
origin: com.google.api/gax

context = context.withTimeout(totalTimeout);
origin: googleapis/gax-java

context = context.withTimeout(totalTimeout);
origin: com.google.cloud/google-cloud-bigtable

if (!externalFuture.getAttemptSettings().getRpcTimeout().isZero()) {
 currentCallContext =
   currentCallContext.withTimeout(externalFuture.getAttemptSettings().getRpcTimeout());
origin: com.google.api/gax

 @Override
 public ResponseT call() {
  ApiCallContext callContext = originalCallContext;

  try {
   Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeout();
   if (!rpcTimeout.isZero()) {
    callContext = callContext.withTimeout(rpcTimeout);
   }

   externalFuture.setAttemptFuture(new NonCancellableFuture<ResponseT>());
   if (externalFuture.isDone()) {
    return null;
   }

   callContext
     .getTracer()
     .attemptStarted(externalFuture.getAttemptSettings().getOverallAttemptCount());

   ApiFuture<ResponseT> internalFuture = callable.futureCall(request, callContext);
   externalFuture.setAttemptFuture(internalFuture);
  } catch (Throwable e) {
   externalFuture.setAttemptFuture(ApiFutures.<ResponseT>immediateFailedFuture(e));
  }

  return null;
 }
}
origin: com.google.api/gax

Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeout();
if (!rpcTimeout.isZero()) {
 callContext = callContext.withTimeout(rpcTimeout);
origin: googleapis/gax-java

 @Override
 public ResponseT call() {
  ApiCallContext callContext = originalCallContext;

  try {
   Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeout();
   if (!rpcTimeout.isZero()) {
    callContext = callContext.withTimeout(rpcTimeout);
   }

   externalFuture.setAttemptFuture(new NonCancellableFuture<ResponseT>());
   if (externalFuture.isDone()) {
    return null;
   }

   callContext
     .getTracer()
     .attemptStarted(externalFuture.getAttemptSettings().getOverallAttemptCount());

   ApiFuture<ResponseT> internalFuture = callable.futureCall(request, callContext);
   externalFuture.setAttemptFuture(internalFuture);
  } catch (Throwable e) {
   externalFuture.setAttemptFuture(ApiFutures.<ResponseT>immediateFailedFuture(e));
  }

  return null;
 }
}
origin: googleapis/gax-java

Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeout();
if (!rpcTimeout.isZero()) {
 callContext = callContext.withTimeout(rpcTimeout);
com.google.api.gax.rpcApiCallContextwithTimeout

Javadoc

Returns a new ApiCallContext with the given timeout set.

This sets the maximum amount of time a single unary RPC attempt can take. If retries are enabled, then this can take much longer. Unlike a deadline, timeouts are relative durations that are measure from the beginning of each RPC attempt. Please note that this will limit the duration of a server streaming RPC as well.

Popular methods of ApiCallContext

  • getStreamIdleTimeout
    The stream idle timeout set for this context.
  • getStreamWaitTimeout
    Return the stream wait timeout set for this context.
  • getTimeout
    Returns the configured per-RPC timeout.
  • getTracer
    The ApiTracer that was previously set for this context.The ApiTracer will be used to trace the curre
  • nullToSelf
    If inputContext is not null, returns it; if it is null, returns the present instance.
  • merge
    For any values in inputCallContext that are not null, override the corresponding values in the prese
  • withCredentials
    Returns a new ApiCallContext with the given credentials set.
  • withStreamIdleTimeout
    Returns a new ApiCallContext with the given stream idle timeout set.This timeout only applies to a S
  • withStreamWaitTimeout
    Returns a new ApiCallContext with the given stream timeout set.This timeout only applies to a Server
  • withTracer
    Returns a new ApiCallContext with the given ApiTracer.The ApiTracer will be used to trace the curren
  • withTransportChannel
    Returns a new ApiCallContext with the given channel set.
  • withTransportChannel

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
  • Menu (java.awt)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now