public abstract static class ServerCall.Listener<RequestT> extends Object
Any contexts are guaranteed to arrive before any payloads, which are guaranteed before half close, which is guaranteed before completion.
Implementations are free to block for extended periods of time. Implementations are not required to be thread-safe.
Constructor and Description |
---|
Listener() |
Modifier and Type | Method and Description |
---|---|
abstract void |
onCancel()
The call was cancelled and the server is encouraged to abort processing to save resources,
since the client will not process any further messages.
|
abstract void |
onComplete()
The call is considered complete and
onCancel() is guaranteed not to be called. |
abstract void |
onHalfClose()
The client completed all message sending.
|
abstract void |
onPayload(RequestT payload)
A request message has been received.
|
void |
onReady()
This indicates that the call is now capable of sending additional messages (via
ServerCall.sendPayload(ResponseT) ) without requiring excessive buffering internally. |
public abstract void onPayload(RequestT payload)
payload
- a received request message.public abstract void onHalfClose()
public abstract void onCancel()
There will be no further callbacks for the call.
public abstract void onComplete()
onCancel()
is guaranteed not to be called.
However, the client is not guaranteed to have received all messages.
There will be no further callbacks for the call.
public void onReady()
ServerCall.sendPayload(ResponseT)
) 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.