public class GrpcServerResponse<Req,Resp> extends GrpcWriteStream<Resp>
Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<GrpcServerResponse> |
__TYPE_ARG |
io.vertx.lang.rx.TypeArg<Req> |
__typeArg_0 |
io.vertx.lang.rx.TypeArg<Resp> |
__typeArg_1 |
Constructor and Description |
---|
GrpcServerResponse(GrpcServerResponse delegate) |
GrpcServerResponse(Object delegate,
io.vertx.lang.rx.TypeArg<Req> typeArg_0,
io.vertx.lang.rx.TypeArg<Resp> typeArg_1) |
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 . |
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(Resp data)
Same as but with an
handler called when the operation completes |
void |
end(Resp data,
Handler<AsyncResult<Void>> handler)
Same as but with an
handler called when the operation completes |
boolean |
equals(Object o) |
GrpcServerResponse<Req,Resp> |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the write stream.
|
GrpcServerResponse |
getDelegate() |
int |
hashCode() |
static <Req,Resp> GrpcServerResponse<Req,Resp> |
newInstance(GrpcServerResponse arg) |
static <Req,Resp> GrpcServerResponse<Req,Resp> |
newInstance(GrpcServerResponse arg,
io.vertx.lang.rx.TypeArg<Req> __typeArg_Req,
io.vertx.lang.rx.TypeArg<Resp> __typeArg_Resp) |
Completable |
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 |
Completable |
rxEnd(Resp data)
Same as but with an
handler called when the operation completes |
Completable |
rxSend(Flowable<Resp> body) |
Completable |
rxSend(ReadStream<Resp> body) |
Completable |
rxSend(Resp item) |
Completable |
rxWrite(Resp data)
Same as but with an
handler called when the operation completes |
Future<Void> |
send(Flowable<Resp> body) |
Future<Void> |
send(ReadStream<Resp> body) |
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
|
GrpcServerResponse<Req,Resp> |
statusMessage(String msg)
Set the grpc status response message
|
WriteStreamObserver<Resp> |
toObserver() |
String |
toString() |
WriteStreamSubscriber<Resp> |
toSubscriber() |
MultiMap |
trailers() |
void |
write(Resp data)
Same as but with an
handler called when the operation completes |
void |
write(Resp data,
Handler<AsyncResult<Void>> handler)
Same as but with an
handler called when the operation completes |
boolean |
writeQueueFull()
This will return
true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int) |
cancel, endMessage, headers, newInstance, newInstance, rxEndMessage, rxWriteMessage, writeMessage
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
newInstance, newInstance
newInstance
public static final io.vertx.lang.rx.TypeArg<GrpcServerResponse> __TYPE_ARG
public final io.vertx.lang.rx.TypeArg<Req> __typeArg_0
public final io.vertx.lang.rx.TypeArg<Resp> __typeArg_1
public GrpcServerResponse(GrpcServerResponse delegate)
public String toString()
toString
in class GrpcWriteStream<Resp>
public boolean equals(Object o)
equals
in class GrpcWriteStream<Resp>
public int hashCode()
hashCode
in class GrpcWriteStream<Resp>
public GrpcServerResponse getDelegate()
getDelegate
in interface StreamBase
getDelegate
in interface WriteStream<Resp>
getDelegate
in class GrpcWriteStream<Resp>
public WriteStreamObserver<Resp> toObserver()
toObserver
in class GrpcWriteStream<Resp>
public WriteStreamSubscriber<Resp> toSubscriber()
toSubscriber
in class GrpcWriteStream<Resp>
public void write(Resp data, Handler<AsyncResult<Void>> handler)
handler
called when the operation completeswrite
in interface WriteStream<Resp>
write
in class GrpcWriteStream<Resp>
data
- handler
- public void write(Resp data)
handler
called when the operation completeswrite
in interface WriteStream<Resp>
write
in class GrpcWriteStream<Resp>
data
- public Completable rxWrite(Resp data)
handler
called when the operation completesrxWrite
in interface WriteStream<Resp>
rxWrite
in class GrpcWriteStream<Resp>
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<Resp>
end
in class GrpcWriteStream<Resp>
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<Resp>
end
in class GrpcWriteStream<Resp>
public Completable 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<Resp>
rxEnd
in class GrpcWriteStream<Resp>
public void end(Resp data, Handler<AsyncResult<Void>> handler)
handler
called when the operation completesend
in interface WriteStream<Resp>
end
in class GrpcWriteStream<Resp>
data
- handler
- public void end(Resp data)
handler
called when the operation completesend
in interface WriteStream<Resp>
end
in class GrpcWriteStream<Resp>
data
- public Completable rxEnd(Resp data)
handler
called when the operation completesrxEnd
in interface WriteStream<Resp>
rxEnd
in class GrpcWriteStream<Resp>
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<Resp>
writeQueueFull
in class GrpcWriteStream<Resp>
true
if write queue is fullpublic GrpcServerResponse<Req,Resp> status(GrpcStatus status)
status
- the statuspublic GrpcServerResponse<Req,Resp> statusMessage(String msg)
msg
- the messagepublic GrpcServerResponse<Req,Resp> encoding(String encoding)
GrpcWriteStream
identity
or gzip
.
It must be called before sending any message, otherwise {@code identity will be used.encoding
in class GrpcWriteStream<Resp>
encoding
- the target message encodingpublic MultiMap trailers()
public GrpcServerResponse<Req,Resp> exceptionHandler(Handler<Throwable> handler)
WriteStream
exceptionHandler
in interface StreamBase
exceptionHandler
in interface WriteStream<Resp>
exceptionHandler
in class GrpcWriteStream<Resp>
handler
- the exception handlerpublic GrpcServerResponse<Req,Resp> setWriteQueueMaxSize(int maxSize)
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<Resp>
setWriteQueueMaxSize
in class GrpcWriteStream<Resp>
maxSize
- the max size of the write streampublic GrpcServerResponse<Req,Resp> 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<Resp>
drainHandler
in class GrpcWriteStream<Resp>
handler
- the handlerpublic Completable rxSend(Resp item)
public Future<Void> send(ReadStream<Resp> body)
public Completable rxSend(ReadStream<Resp> body)
public Completable rxSend(Flowable<Resp> body)
public static <Req,Resp> GrpcServerResponse<Req,Resp> newInstance(GrpcServerResponse arg)
public static <Req,Resp> GrpcServerResponse<Req,Resp> newInstance(GrpcServerResponse arg, io.vertx.lang.rx.TypeArg<Req> __typeArg_Req, io.vertx.lang.rx.TypeArg<Resp> __typeArg_Resp)
Copyright © 2024 Eclipse. All rights reserved.