public abstract static class ClientCall.Listener<T> extends Object
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 |
onClose(Status status,
Metadata.Trailers trailers)
The ClientCall has been closed.
|
abstract void |
onHeaders(Metadata.Headers headers)
The response headers have been received.
|
abstract void |
onMessage(T message)
A response message has been received.
|
void |
onReady()
This indicates that the ClientCall is now capable of sending additional messages (via
ClientCall.sendMessage(RequestT) ) without requiring excessive buffering internally. |
public abstract void onHeaders(Metadata.Headers headers)
Metadata
is passed.headers
- containing metadata sent by the server at the start of the response.public abstract void onMessage(T message)
message
- returned by the serverpublic abstract void onClose(Status status, Metadata.Trailers trailers)
ClientCall
will not be
processed by the server. No further receiving will occur and no further notifications will be
made.
If status
is not equal to Status.OK
, then the call failed. An additional
block of trailer metadata may be received at the end of the call from the server. An empty
Metadata
object is passed if no trailers are received.
status
- the result of the remote call.trailers
- metadata provided at call completion.public void onReady()
ClientCall.sendMessage(RequestT)
) 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 ClientCall.