public abstract class ForwardingCall<ReqT,RespT> extends Call<ReqT,RespT>
| Modifier and Type | Class and Description |
|---|---|
static class |
ForwardingCall.SimpleForwardingCall<ReqT,RespT>
A simplified version of
ForwardingCall where subclasses can pass in a Call as
the delegate. |
Call.Listener<T>| Constructor and Description |
|---|
ForwardingCall() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Prevent any further processing for this Call.
|
protected abstract Call<ReqT,RespT> |
delegate()
Returns the delegated
Call. |
void |
halfClose()
Close the call for request message sending.
|
boolean |
isReady()
If
true, indicates that the call is capable of sending additional messages
without requiring excessive buffering internally. |
void |
request(int numMessages)
Requests up to the given number of messages from the call to be delivered to
Call.Listener.onPayload(Object). |
void |
sendPayload(ReqT payload)
Send a request message to the server.
|
void |
start(Call.Listener<RespT> responseListener,
Metadata.Headers headers)
Start a call, using
responseListener for processing response messages. |
public void start(Call.Listener<RespT> responseListener, Metadata.Headers headers)
CallresponseListener for processing response messages.public void request(int numMessages)
CallCall.Listener.onPayload(Object). No additional messages will be delivered.
Message delivery is guaranteed to be sequential in the order received. In addition, the listener methods will not be accessed concurrently. While it is not guaranteed that the same thread will always be used, it is guaranteed that only a single thread will access the listener at a time.
If it is desired to bypass inbound flow control, a very large number of messages can be
specified (e.g. Integer.MAX_VALUE).
public void cancel()
Callcancel()ed or Call.halfClose()d.public void halfClose()
Callpublic void sendPayload(ReqT payload)
CallsendPayload in class Call<ReqT,RespT>payload - message to be sent to the server.public boolean isReady()
Calltrue, indicates that the call is capable of sending additional messages
without requiring excessive buffering internally. This event is
just a suggestion and the application is free to ignore it, however doing so may
result in excessive buffering within the call.
This implementation always returns true.