Tabnine Logo
ApiCallContext.getStreamIdleTimeout
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.google.api/gax

 @Override
 public void call(
   RequestT request, ResponseObserver<ResponseT> responseObserver, ApiCallContext context) {

  // If the caller never configured the timeouts, disable them
  Duration waitTimeout = MoreObjects.firstNonNull(context.getStreamWaitTimeout(), Duration.ZERO);
  Duration idleTimeout = MoreObjects.firstNonNull(context.getStreamIdleTimeout(), Duration.ZERO);

  responseObserver = watchdog.watch(responseObserver, waitTimeout, idleTimeout);
  inner.call(request, responseObserver, context);
 }
}
origin: googleapis/gax-java

 @Override
 public void call(
   RequestT request, ResponseObserver<ResponseT> responseObserver, ApiCallContext context) {

  // If the caller never configured the timeouts, disable them
  Duration waitTimeout = MoreObjects.firstNonNull(context.getStreamWaitTimeout(), Duration.ZERO);
  Duration idleTimeout = MoreObjects.firstNonNull(context.getStreamIdleTimeout(), Duration.ZERO);

  responseObserver = watchdog.watch(responseObserver, waitTimeout, idleTimeout);
  inner.call(request, responseObserver, context);
 }
}
origin: googleapis/gax-java

@Test
public void testMergeWithNullStreamingIdleTimeout() {
 Duration timeout = Duration.ofSeconds(10);
 GrpcCallContext baseContext = GrpcCallContext.createDefault().withStreamIdleTimeout(timeout);
 GrpcCallContext defaultOverlay = GrpcCallContext.createDefault();
 Truth.assertThat(baseContext.merge(defaultOverlay).getStreamIdleTimeout()).isEqualTo(timeout);
 GrpcCallContext explicitNullOverlay =
   GrpcCallContext.createDefault().withStreamIdleTimeout(null);
 Truth.assertThat(baseContext.merge(explicitNullOverlay).getStreamIdleTimeout())
   .isEqualTo(timeout);
}
origin: googleapis/gax-java

@Test
public void testMergeWithStreamingIdleTimeout() {
 Duration timeout = Duration.ofSeconds(19);
 GrpcCallContext ctx1 = GrpcCallContext.createDefault();
 GrpcCallContext ctx2 = GrpcCallContext.createDefault().withStreamIdleTimeout(timeout);
 Truth.assertThat(ctx1.merge(ctx2).getStreamIdleTimeout()).isEqualTo(timeout);
}
com.google.api.gax.rpcApiCallContextgetStreamIdleTimeout

Javadoc

The stream idle timeout set for this context.

Popular methods of ApiCallContext

  • 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.
  • withTimeout
    Returns a new ApiCallContext with the given timeout set.This sets the maximum amount of time a singl
  • 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

  • Making http requests using okhttp
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JOptionPane (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now