@ThreadSafe @CheckReturnValue public abstract class AbstractAsyncStub<S extends AbstractAsyncStub<S>> extends AbstractStub<S>
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.
AbstractStub.StubFactory<T extends AbstractStub<T>>
Modifier | Constructor and Description |
---|---|
protected |
AbstractAsyncStub(Channel channel,
CallOptions callOptions) |
Modifier and Type | Method and Description |
---|---|
static <T extends AbstractStub<T>> |
newStub(AbstractStub.StubFactory<T> factory,
Channel channel)
Returns a new async stub with the given channel for the provided method configurations.
|
static <T extends AbstractStub<T>> |
newStub(AbstractStub.StubFactory<T> factory,
Channel channel,
CallOptions callOptions)
Returns a new async stub with the given channel for the provided method configurations.
|
build, getCallOptions, getChannel, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOption, withWaitForReady
protected AbstractAsyncStub(Channel channel, CallOptions callOptions)
public static <T extends AbstractStub<T>> T newStub(AbstractStub.StubFactory<T> factory, Channel channel)
factory
- the factory to create an async stubchannel
- the channel that this stub will use to do communicationspublic static <T extends AbstractStub<T>> T newStub(AbstractStub.StubFactory<T> factory, Channel channel, CallOptions callOptions)
factory
- the factory to create an async stubchannel
- the channel that this stub will use to do communicationscallOptions
- the runtime call options to be applied to every call on this stub