public abstract static class Call.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 Call has been closed.
|
abstract void |
onHeaders(Metadata.Headers headers)
The response headers have been received.
|
abstract void |
onPayload(T payload)
A response payload has been received.
|
void |
onReady()
This indicates that the Call is now capable of sending additional messages (via
Call.sendPayload(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 onPayload(T payload)
payload
- returned by the serverpublic abstract void onClose(Status status, Metadata.Trailers trailers)
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()
Call.sendPayload(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 Call.