public interface GrpcWriteStream<T> extends WriteStream<T>
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the stream.
|
GrpcWriteStream<T> |
drainHandler(Handler<Void> handler)
Set a drain handler on the stream.
|
GrpcWriteStream<T> |
encoding(String encoding)
Set the stream encoding, e.g
identity or gzip . |
Future<Void> |
endMessage(GrpcMessage message)
End the stream with an encoded gRPC message.
|
GrpcWriteStream<T> |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the write stream.
|
MultiMap |
headers() |
GrpcWriteStream<T> |
setWriteQueueMaxSize(int i)
Set the maximum size of the write queue to
maxSize . |
Future<Void> |
writeMessage(GrpcMessage message)
Write an encoded gRPC message.
|
end, end, end, end, write, write, writeQueueFull
GrpcWriteStream<T> encoding(String encoding)
identity
or gzip
.
It must be called before sending any message, otherwise {@code identity will be used.encoding
- the target message encodingGrpcWriteStream<T> exceptionHandler(Handler<Throwable> handler)
WriteStream
exceptionHandler
in interface StreamBase
exceptionHandler
in interface WriteStream<T>
handler
- the exception handlerGrpcWriteStream<T> setWriteQueueMaxSize(int i)
WriteStream
maxSize
. 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 WriteStream<T>
i
- the max size of the write streamGrpcWriteStream<T> drainHandler(Handler<Void> handler)
WriteStream
Pipe
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 WriteStream<T>
handler
- the handlerFuture<Void> writeMessage(GrpcMessage message)
message
- the messageFuture<Void> endMessage(GrpcMessage message)
message
- the messagevoid cancel()
Copyright © 2024 Eclipse. All rights reserved.