Tabnine Logo
GrpcCallContext.withStreamWaitTimeout
Code IndexAdd Tabnine to your IDE (free)

How to use
withStreamWaitTimeout
method
in
com.google.api.gax.grpc.GrpcCallContext

Best Java code snippets using com.google.api.gax.grpc.GrpcCallContext.withStreamWaitTimeout (Showing top 6 results out of 315)

origin: googleapis/google-cloud-java

private GrpcCallContext newCallContext(@Nullable Map<Option, ?> options, String resource) {
 GrpcCallContext context = GrpcCallContext.createDefault();
 if (options != null) {
  context = context.withChannelAffinity(Option.CHANNEL_HINT.getLong(options).intValue());
 }
 context = context.withExtraHeaders(metadataProvider.newExtraHeaders(resource, projectName));
 return context.withStreamWaitTimeout(waitTimeout).withStreamIdleTimeout(idleTimeout);
}
origin: com.google.cloud/google-cloud-spanner

private GrpcCallContext newCallContext(@Nullable Map<Option, ?> options, String resource) {
 GrpcCallContext context = GrpcCallContext.createDefault();
 if (options != null) {
  context = context.withChannelAffinity(Option.CHANNEL_HINT.getLong(options).intValue());
 }
 context = context.withExtraHeaders(metadataProvider.newExtraHeaders(resource, projectName));
 return context.withStreamWaitTimeout(waitTimeout).withStreamIdleTimeout(idleTimeout);
}
origin: googleapis/gax-java

@Test
public void testWithZeroStreamingWaitTimeout() {
 Duration timeout = Duration.ZERO;
 Truth.assertThat(
     GrpcCallContext.createDefault().withStreamWaitTimeout(timeout).getStreamWaitTimeout())
   .isEqualTo(timeout);
}
origin: googleapis/gax-java

@Test
public void testWithStreamingWaitTimeout() {
 Duration timeout = Duration.ofSeconds(15);
 GrpcCallContext context = GrpcCallContext.createDefault().withStreamWaitTimeout(timeout);
 Truth.assertThat(context.getStreamWaitTimeout()).isEqualTo(timeout);
}
origin: googleapis/gax-java

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

@Test
public void testMergeWithStreamingWaitTimeout() {
 Duration timeout = Duration.ofSeconds(19);
 GrpcCallContext ctx1 = GrpcCallContext.createDefault();
 GrpcCallContext ctx2 = GrpcCallContext.createDefault().withStreamWaitTimeout(timeout);
 Truth.assertThat(ctx1.merge(ctx2).getStreamWaitTimeout()).isEqualTo(timeout);
}
com.google.api.gax.grpcGrpcCallContextwithStreamWaitTimeout

Popular methods of GrpcCallContext

  • createDefault
    Returns an empty instance with a null channel and default CallOptions.
  • getCallOptions
    The CallOptions set on this context.
  • getChannel
    The Channel set on this context.
  • getExtraHeaders
    The extra header for this context.
  • getTimeout
  • nullToSelf
    Returns inputContext cast to GrpcCallContext, or an empty GrpcCallContext if inputContext is null.
  • of
    Returns an instance with the given channel and CallOptions.
  • withCallOptions
    Returns a new instance with the call options set to the given call options.
  • withChannel
    Returns a new instance with the channel set to the given channel.
  • withChannelAffinity
  • withRequestParamsDynamicHeaderOption
  • <init>
  • withRequestParamsDynamicHeaderOption,
  • <init>,
  • getChannelAffinity,
  • getMetadata,
  • withExtraHeaders,
  • withStreamIdleTimeout,
  • getStreamIdleTimeout,
  • getStreamWaitTimeout,
  • getTracer

Popular in Java

  • Making http post requests using okhttp
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top Sublime Text plugins
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