Class DeadlineClientInterceptor

  • All Implemented Interfaces:
    io.grpc.ClientInterceptor

    public class DeadlineClientInterceptor
    extends Object
    implements io.grpc.ClientInterceptor
    An interceptor that enforces given deadline for a call.
    • Method Detail

      • interceptCall

        public <ReqT,​RespT> io.grpc.ClientCall<ReqT,​RespT> interceptCall​(io.grpc.MethodDescriptor<ReqT,​RespT> method,
                                                                                     io.grpc.CallOptions callOptions,
                                                                                     io.grpc.Channel next)
        Specified by:
        interceptCall in interface io.grpc.ClientInterceptor
      • fromDuration

        public static DeadlineClientInterceptor fromDuration​(Duration timeout)
        Create a DeadlineClientInterceptor with given timeout
        Parameters:
        timeout - timeout after which a call fails if it is still not completed
        Returns:
        DeadlineClientInterceptor object