Class ClientCalls.UnaryStreamToFuture<RespT>
java.lang.Object
io.grpc.ClientCall.Listener<RespT>
io.grpc.stub.ClientCalls.StartableListener<RespT>
io.grpc.stub.ClientCalls.UnaryStreamToFuture<RespT>
- Enclosing class:
ClientCalls
private static final class ClientCalls.UnaryStreamToFuture<RespT>
extends ClientCalls.StartableListener<RespT>
Completes a
ClientCalls.GrpcFuture using StreamObserver events.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final ClientCalls.GrpcFuture<RespT> private RespT -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ClientCall.Listener
onReady
-
Field Details
-
responseFuture
-
value
-
isValueReceived
private boolean isValueReceived
-
-
Constructor Details
-
UnaryStreamToFuture
UnaryStreamToFuture(ClientCalls.GrpcFuture<RespT> responseFuture)
-
-
Method Details
-
onHeaders
Description copied from class:ClientCall.ListenerThe response headers have been received. Headers always precede messages.Since
Metadatais not thread-safe, the caller must not access (read or write)headersafter this point.- Overrides:
onHeadersin classClientCall.Listener<RespT>- Parameters:
headers- containing metadata sent by the server at the start of the response.
-
onMessage
Description copied from class:ClientCall.ListenerA response message has been received. May be called zero or more times depending on whether the call response is empty, a single message or a stream of messages.- Overrides:
onMessagein classClientCall.Listener<RespT>- Parameters:
value- returned by the server
-
onClose
Description copied from class:ClientCall.ListenerThe ClientCall has been closed. Any additional calls to theClientCallwill not be processed by the server. No further receiving will occur and no further notifications will be made.Since
Metadatais not thread-safe, the caller must not access (read or write)trailersafter this point.If
statusreturns false forStatus.isOk(), then the call failed. An additional block of trailer metadata may be received at the end of the call from the server. An emptyMetadataobject is passed if no trailers are received.This method should not throw. If this method throws, there is no way to be notified of the exception. Implementations should therefore be careful of exceptions which can accidentally leak resources.
- Overrides:
onClosein classClientCall.Listener<RespT>- Parameters:
status- the result of the remote call.trailers- metadata provided at call completion.
-
onStart
void onStart()- Specified by:
onStartin classClientCalls.StartableListener<RespT>
-