Package io.grpc.stub

Class AbstractBlockingStub<S extends AbstractBlockingStub<S>>


  • @ThreadSafe
    @CheckReturnValue
    public abstract class AbstractBlockingStub<S extends AbstractBlockingStub<S>>
    extends AbstractStub<S>
    Stub implementations for blocking stubs.

    DO NOT MOCK: Customizing options doesn't work properly in mocks. Use InProcessChannelBuilder to create a real channel suitable for testing. It is also possible to mock Channel instead.

    Since:
    1.26.0
    • Constructor Detail

      • AbstractBlockingStub

        protected AbstractBlockingStub​(io.grpc.Channel channel,
                                       io.grpc.CallOptions callOptions)
    • Method Detail

      • newStub

        public static <T extends AbstractStub<T>> T newStub​(AbstractStub.StubFactory<T> factory,
                                                            io.grpc.Channel channel)
        Returns a new blocking stub with the given channel for the provided method configurations.
        Parameters:
        factory - the factory to create a blocking stub
        channel - the channel that this stub will use to do communications
        Since:
        1.26.0
      • newStub

        public static <T extends AbstractStub<T>> T newStub​(AbstractStub.StubFactory<T> factory,
                                                            io.grpc.Channel channel,
                                                            io.grpc.CallOptions callOptions)
        Returns a new blocking stub with the given channel for the provided method configurations.
        Parameters:
        factory - the factory to create a blocking stub
        channel - the channel that this stub will use to do communications
        callOptions - the runtime call options to be applied to every call on this stub
        Since:
        1.26.0