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

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

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

origin: com.google.api/gax-grpc

if (grpcContext.getTimeout() != null) {
 Deadline newDeadline =
   Deadline.after(grpcContext.getTimeout().toMillis(), TimeUnit.MILLISECONDS);
 Deadline oldDeadline = callOptions.getDeadline();
origin: googleapis/gax-java

if (grpcContext.getTimeout() != null) {
 Deadline newDeadline =
   Deadline.after(grpcContext.getTimeout().toMillis(), TimeUnit.MILLISECONDS);
 Deadline oldDeadline = callOptions.getDeadline();
origin: googleapis/gax-java

@Test
public void testWithTimeout() {
 Truth.assertThat(GrpcCallContext.createDefault().withTimeout(null).getTimeout()).isNull();
}
origin: googleapis/gax-java

@Test
public void testWithZeroTimeout() {
 Truth.assertThat(
     GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(0L)).getTimeout())
   .isNull();
}
origin: googleapis/gax-java

@Test
public void testWithLongerTimeout() {
 GrpcCallContext ctxWithShortTimeout =
   GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(5));
 // Sanity check
 Truth.assertThat(ctxWithShortTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5));
 // Try to extend the timeout and verify that it was ignored
 GrpcCallContext ctxWithUnchangedTimeout =
   ctxWithShortTimeout.withTimeout(Duration.ofSeconds(10));
 Truth.assertThat(ctxWithUnchangedTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5));
}
origin: googleapis/gax-java

@Test
public void testWithShorterTimeout() {
 GrpcCallContext ctxWithLongTimeout =
   GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10));
 // Sanity check
 Truth.assertThat(ctxWithLongTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(10));
 // Shorten the timeout and make sure it changed
 GrpcCallContext ctxWithShorterTimeout = ctxWithLongTimeout.withTimeout(Duration.ofSeconds(5));
 Truth.assertThat(ctxWithShorterTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5));
}
origin: googleapis/gax-java

@Test
public void testWithNegativeTimeout() {
 Truth.assertThat(
     GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(-1L)).getTimeout())
   .isNull();
}
com.google.api.gax.grpcGrpcCallContextgetTimeout

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.
  • 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>
  • getChannelAffinity
    The channel affinity for this context.
  • <init>,
  • getChannelAffinity,
  • getMetadata,
  • withExtraHeaders,
  • withStreamIdleTimeout,
  • withStreamWaitTimeout,
  • getStreamIdleTimeout,
  • getStreamWaitTimeout,
  • getTracer

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • 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