Class GrpcBufferingInterceptor

  • All Implemented Interfaces:
    io.grpc.ClientInterceptor

    public class GrpcBufferingInterceptor
    extends Object
    implements io.grpc.ClientInterceptor
    Interceptor that immediately requests a number of messages from the server, to increase the flow of messages.

    As an additional message is requested by default each time a message is received, setting an initial request amount will allow that number of messages to be "in transit" before the server stops sending more.

    • Constructor Detail

      • GrpcBufferingInterceptor

        public GrpcBufferingInterceptor​(int additionalBuffer)
        Initialize the interceptor to ask for additionalBuffer amount of messages from the server.
        Parameters:
        additionalBuffer - the number of messages the server may send before waiting for permits to be renewed
    • Method Detail

      • interceptCall

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