Package io.vertx.grpc.client
Interface GrpcClientResponse<Req,Resp>
-
- All Superinterfaces:
GrpcReadStream<Resp>
,ReadStream<Resp>
,StreamBase
public interface GrpcClientResponse<Req,Resp> extends GrpcReadStream<Resp>
A response from a gRPC server. You can set amessageHandler(Handler)
to receiveGrpcMessage
and aendHandler(Handler)
to be notified of the end of the response.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GrpcClientResponse<Req,Resp>
endHandler(Handler<Void> handler)
Set an end handler.GrpcClientResponse<Req,Resp>
errorHandler(Handler<GrpcError> handler)
Set a handler to be notified with gRPC errors.GrpcClientResponse<Req,Resp>
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the read stream.GrpcClientResponse<Req,Resp>
fetch(long amount)
Fetch the specifiedamount
of elements.GrpcClientResponse<Req,Resp>
handler(Handler<Resp> handler)
Set a data handler.GrpcClientResponse<Req,Resp>
messageHandler(Handler<GrpcMessage> handler)
Set a handler to be notified with incoming encoded messages.GrpcClientResponse<Req,Resp>
pause()
Pause theReadStream
, it sets the buffer infetch
mode and clears the actual demand.GrpcClientResponse<Req,Resp>
resume()
Resume reading, and sets the buffer inflowing
mode.GrpcStatus
status()
String
statusMessage()
MultiMap
trailers()
-
Methods inherited from interface io.vertx.grpc.common.GrpcReadStream
encoding, end, format, headers, invalidMessageHandler, last
-
Methods inherited from interface io.vertx.core.streams.ReadStream
collect, pipe, pipeTo
-
-
-
-
Method Detail
-
status
GrpcStatus status()
- Returns:
- the gRPC status or
null
when the status has not yet been received
-
statusMessage
String statusMessage()
- Returns:
- the gRPC status message of
null
when the status has not yet been received or not transmitted
-
messageHandler
GrpcClientResponse<Req,Resp> messageHandler(Handler<GrpcMessage> handler)
Description copied from interface:GrpcReadStream
Set a handler to be notified with incoming encoded messages. Thehandler
is responsible for fully decoding incoming messages, including compression.- Specified by:
messageHandler
in interfaceGrpcReadStream<Req>
- Parameters:
handler
- the message handler- Returns:
- a reference to this, so the API can be used fluently
-
errorHandler
GrpcClientResponse<Req,Resp> errorHandler(Handler<GrpcError> handler)
Description copied from interface:GrpcReadStream
Set a handler to be notified with gRPC errors.- Specified by:
errorHandler
in interfaceGrpcReadStream<Req>
- Parameters:
handler
- the error handler- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
GrpcClientResponse<Req,Resp> exceptionHandler(Handler<Throwable> handler)
Description copied from interface:ReadStream
Set an exception handler on the read stream.- Specified by:
exceptionHandler
in interfaceGrpcReadStream<Req>
- Specified by:
exceptionHandler
in interfaceReadStream<Req>
- Specified by:
exceptionHandler
in interfaceStreamBase
- Parameters:
handler
- the exception handler- Returns:
- a reference to this, so the API can be used fluently
-
handler
GrpcClientResponse<Req,Resp> handler(Handler<Resp> handler)
Description copied from interface:ReadStream
Set a data handler. As data is read, the handler will be called with the data.- Specified by:
handler
in interfaceGrpcReadStream<Req>
- Specified by:
handler
in interfaceReadStream<Req>
- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
GrpcClientResponse<Req,Resp> endHandler(Handler<Void> handler)
Description copied from interface:ReadStream
Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.- Specified by:
endHandler
in interfaceGrpcReadStream<Req>
- Specified by:
endHandler
in interfaceReadStream<Req>
- Returns:
- a reference to this, so the API can be used fluently
-
pause
GrpcClientResponse<Req,Resp> pause()
Description copied from interface:ReadStream
Pause theReadStream
, it sets the buffer infetch
mode and clears the actual demand.While it's paused, no data will be sent to the data
handler
.- Specified by:
pause
in interfaceGrpcReadStream<Req>
- Specified by:
pause
in interfaceReadStream<Req>
- Returns:
- a reference to this, so the API can be used fluently
-
resume
GrpcClientResponse<Req,Resp> resume()
Description copied from interface:ReadStream
Resume reading, and sets the buffer inflowing
mode. If theReadStream
has been paused, reading will recommence on it.- Specified by:
resume
in interfaceGrpcReadStream<Req>
- Specified by:
resume
in interfaceReadStream<Req>
- Returns:
- a reference to this, so the API can be used fluently
-
fetch
GrpcClientResponse<Req,Resp> fetch(long amount)
Description copied from interface:ReadStream
Fetch the specifiedamount
of elements. If theReadStream
has been paused, reading will recommence with the specifiedamount
of items, otherwise the specifiedamount
will be added to the current stream demand.- Specified by:
fetch
in interfaceGrpcReadStream<Req>
- Specified by:
fetch
in interfaceReadStream<Req>
- Returns:
- a reference to this, so the API can be used fluently
-
-