public class GrpcWriteStream<T> extends Object implements WriteStream<T>
Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<GrpcWriteStream> |
__TYPE_ARG |
io.vertx.lang.rx.TypeArg<T> |
__typeArg_0 |
Constructor and Description |
---|
GrpcWriteStream(GrpcWriteStream delegate) |
GrpcWriteStream(Object delegate,
io.vertx.lang.rx.TypeArg<T> typeArg_0) |
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 . |
void |
end()
Same as
WriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
void |
end(Handler<AsyncResult<Void>> handler)
Same as
WriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
void |
end(T data)
Same as but with an
handler called when the operation completes |
void |
end(T data,
Handler<AsyncResult<Void>> handler)
Same as but with an
handler called when the operation completes |
Future<Void> |
endMessage(GrpcMessage message)
End the stream with an encoded gRPC message.
|
boolean |
equals(Object o) |
GrpcWriteStream<T> |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the write stream.
|
GrpcWriteStream |
getDelegate() |
int |
hashCode() |
MultiMap |
headers() |
static <T> GrpcWriteStream<T> |
newInstance(GrpcWriteStream arg) |
static <T> GrpcWriteStream<T> |
newInstance(GrpcWriteStream arg,
io.vertx.lang.rx.TypeArg<T> __typeArg_T) |
Single<Void> |
rxEnd()
Same as
WriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but with an handler called when the operation completes |
Single<Void> |
rxEnd(T data)
Same as but with an
handler called when the operation completes |
Single<Void> |
rxEndMessage(GrpcMessage message)
End the stream with an encoded gRPC message.
|
Single<Void> |
rxWrite(T data)
Same as but with an
handler called when the operation completes |
Single<Void> |
rxWriteMessage(GrpcMessage message)
Write an encoded gRPC message.
|
GrpcWriteStream<T> |
setWriteQueueMaxSize(int i)
Set the maximum size of the write queue to
maxSize . |
String |
toString() |
WriteStreamSubscriber<T> |
toSubscriber() |
void |
write(T data)
Same as but with an
handler called when the operation completes |
void |
write(T data,
Handler<AsyncResult<Void>> handler)
Same as but with an
handler called when the operation completes |
Future<Void> |
writeMessage(GrpcMessage message)
Write an encoded gRPC message.
|
boolean |
writeQueueFull()
This will return
true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
newInstance, newInstance
newInstance
public static final io.vertx.lang.rx.TypeArg<GrpcWriteStream> __TYPE_ARG
public final io.vertx.lang.rx.TypeArg<T> __typeArg_0
public GrpcWriteStream(GrpcWriteStream delegate)
public GrpcWriteStream getDelegate()
getDelegate
in interface StreamBase
getDelegate
in interface WriteStream<T>
public WriteStreamSubscriber<T> toSubscriber()
public void write(T data, Handler<AsyncResult<Void>> handler)
handler
called when the operation completeswrite
in interface WriteStream<T>
data
- handler
- public void write(T data)
handler
called when the operation completeswrite
in interface WriteStream<T>
data
- public Single<Void> rxWrite(T data)
handler
called when the operation completesrxWrite
in interface WriteStream<T>
data
- public void end(Handler<AsyncResult<Void>> handler)
WriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesend
in interface WriteStream<T>
handler
- public void end()
WriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesend
in interface WriteStream<T>
public Single<Void> rxEnd()
WriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
but with an handler
called when the operation completesrxEnd
in interface WriteStream<T>
public void end(T data, Handler<AsyncResult<Void>> handler)
handler
called when the operation completesend
in interface WriteStream<T>
data
- handler
- public void end(T data)
handler
called when the operation completesend
in interface WriteStream<T>
data
- public Single<Void> rxEnd(T data)
handler
called when the operation completesrxEnd
in interface WriteStream<T>
data
- public boolean writeQueueFull()
true
if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int)
writeQueueFull
in interface WriteStream<T>
true
if write queue is fullpublic MultiMap headers()
public 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 encodingpublic GrpcWriteStream<T> exceptionHandler(Handler<Throwable> handler)
WriteStream
exceptionHandler
in interface StreamBase
exceptionHandler
in interface WriteStream<T>
handler
- the exception handlerpublic GrpcWriteStream<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 streampublic GrpcWriteStream<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 handlerpublic Future<Void> writeMessage(GrpcMessage message)
message
- the messagepublic Single<Void> rxWriteMessage(GrpcMessage message)
message
- the messagepublic Future<Void> endMessage(GrpcMessage message)
message
- the messagepublic Single<Void> rxEndMessage(GrpcMessage message)
message
- the messagepublic void cancel()
public static <T> GrpcWriteStream<T> newInstance(GrpcWriteStream arg)
public static <T> GrpcWriteStream<T> newInstance(GrpcWriteStream arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)
Copyright © 2023 Eclipse. All rights reserved.