public interface GrpcServerResponse<Req,Resp> extends GrpcWriteStream<Resp>
| Modifier and Type | Method and Description |
|---|---|
GrpcServerResponse<Req,Resp> |
drainHandler(Handler<Void> handler)
Set a drain handler on the stream.
|
GrpcServerResponse<Req,Resp> |
encoding(String encoding)
Set the stream encoding, e.g
identity or gzip. |
GrpcServerResponse<Req,Resp> |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the write stream.
|
default Future<Void> |
send(ReadStream<Resp> body) |
default Future<Void> |
send(Resp item) |
GrpcServerResponse<Req,Resp> |
setWriteQueueMaxSize(int maxSize)
Set the maximum size of the write queue to
maxSize. |
GrpcServerResponse<Req,Resp> |
status(GrpcStatus status)
Set the grpc status response
|
MultiMap |
trailers() |
cancel, endMessage, headers, writeMessageend, end, end, end, write, write, writeQueueFullGrpcServerResponse<Req,Resp> status(GrpcStatus status)
status - the statusGrpcServerResponse<Req,Resp> encoding(String encoding)
GrpcWriteStreamidentity or gzip.
It must be called before sending any message, otherwise {@code identity will be used.encoding in interface GrpcWriteStream<Resp>encoding - the target message encodingGrpcServerResponse<Req,Resp> exceptionHandler(Handler<Throwable> handler)
WriteStreamexceptionHandler in interface GrpcWriteStream<Resp>exceptionHandler in interface StreamBaseexceptionHandler in interface WriteStream<Resp>handler - the exception handlerGrpcServerResponse<Req,Resp> setWriteQueueMaxSize(int maxSize)
WriteStreammaxSize. You will still be able to write to the stream even
if there is more than maxSize items in the write queue. This is used as an indicator by classes such as
Pipe to provide flow control.
The value is defined by the implementation of the stream, e.g in bytes for a
NetSocket, etc...setWriteQueueMaxSize in interface GrpcWriteStream<Resp>setWriteQueueMaxSize in interface WriteStream<Resp>maxSize - the max size of the write streamGrpcServerResponse<Req,Resp> drainHandler(Handler<Void> handler)
WriteStreamPipe for an example of this being used.
The stream implementation defines when the drain handler, for example it could be when the queue size has been
reduced to maxSize / 2.
drainHandler in interface GrpcWriteStream<Resp>drainHandler in interface WriteStream<Resp>handler - the handlerdefault Future<Void> send(ReadStream<Resp> body)
Copyright © 2023 Eclipse. All rights reserved.