public interface GrpcBidiExchange<I,O> extends GrpcReadStream<I>, GrpcWriteStream<O>
| Modifier and Type | Method and Description |
|---|---|
static <I,O> GrpcBidiExchange<I,O> |
create(GrpcReadStream<I> readStream,
io.grpc.stub.StreamObserver<O> writeObserver) |
static <I,O> GrpcBidiExchange<I,O> |
create(io.grpc.stub.StreamObserver<I> readObserver,
io.grpc.stub.StreamObserver<O> writeObserver) |
GrpcBidiExchange<I,O> |
drainHandler(Handler<Void> handler)
Set a drain handler on the stream.
|
GrpcBidiExchange<I,O> |
endHandler(Handler<Void> handler)
Set an end handler.
|
GrpcBidiExchange<I,O> |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the read stream.
|
GrpcBidiExchange<I,O> |
fail(Throwable t)
Send an error event into the stream.
|
GrpcBidiExchange<I,O> |
fetch(long amount)
Fetch the specified
amount of elements. |
GrpcBidiExchange<I,O> |
handler(Handler<I> handler)
Set a data handler.
|
GrpcBidiExchange<I,O> |
pause()
Pause the
ReadSupport. |
io.grpc.stub.StreamObserver<I> |
readObserver()
Should not be used by end user, it is a simple accessor the the underlying gRPC StreamObserver.
|
GrpcBidiExchange<I,O> |
resume()
Resume reading.
|
GrpcBidiExchange<I,O> |
setReadObserver(io.grpc.stub.StreamObserver<I> observer) |
GrpcBidiExchange<I,O> |
setWriteQueueMaxSize(int maxSize)
Set the maximum size of the write queue to
maxSize. |
GrpcBidiExchange<I,O> |
write(O data)
Write some data to the stream.
|
io.grpc.stub.StreamObserver<O> |
writeObserver()
Should not be used by end user, it is a simple accessor the the underlying gRPC StreamObserver.
|
create, createpipe, pipeTo, pipeTocreateend, end, end, end, write, writeQueueFullstatic <I,O> GrpcBidiExchange<I,O> create(GrpcReadStream<I> readStream, io.grpc.stub.StreamObserver<O> writeObserver)
static <I,O> GrpcBidiExchange<I,O> create(io.grpc.stub.StreamObserver<I> readObserver, io.grpc.stub.StreamObserver<O> writeObserver)
GrpcBidiExchange<I,O> exceptionHandler(Handler<Throwable> handler)
GrpcReadStreamexceptionHandler in interface GrpcReadStream<I>exceptionHandler in interface GrpcWriteStream<O>exceptionHandler in interface ReadStream<I>exceptionHandler in interface StreamBaseexceptionHandler in interface WriteStream<O>handler - the exception handlerGrpcBidiExchange<I,O> write(O data)
GrpcWriteStreamWriteStream.writeQueueFull() method before writing. This is done automatically if using a Pump.write in interface GrpcWriteStream<O>write in interface WriteStream<O>data - the data to writeGrpcBidiExchange<I,O> setWriteQueueMaxSize(int maxSize)
GrpcWriteStreammaxSize. 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
Pump to provide flow control.
The value is defined by the implementation of the stream, e.g in bytes for a
NetSocket, the number of Message for a
MessageProducer, etc...setWriteQueueMaxSize in interface GrpcWriteStream<O>setWriteQueueMaxSize in interface WriteStream<O>maxSize - the max size of the write streamGrpcBidiExchange<I,O> drainHandler(Handler<Void> handler)
GrpcWriteStreamPump 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<O>drainHandler in interface WriteStream<O>handler - the handlerGrpcBidiExchange<I,O> fail(Throwable t)
GrpcWriteStreamfail in interface GrpcWriteStream<O>t - any errorGrpcBidiExchange<I,O> handler(Handler<I> handler)
GrpcReadStreamhandler in interface GrpcReadStream<I>handler in interface ReadStream<I>GrpcBidiExchange<I,O> pause()
GrpcReadStreamReadSupport. While it's paused, no data will be sent to the dataHandlerpause in interface GrpcReadStream<I>pause in interface ReadStream<I>GrpcBidiExchange<I,O> resume()
GrpcReadStreamReadSupport has been paused, reading will recommence on it.resume in interface GrpcReadStream<I>resume in interface ReadStream<I>GrpcBidiExchange<I,O> fetch(long amount)
GrpcReadStreamamount of elements. If the ReadStream has been paused, reading will
recommence with the specified amount of items, otherwise the specified amount will
be added to the current stream demand.fetch in interface GrpcReadStream<I>fetch in interface ReadStream<I>GrpcBidiExchange<I,O> endHandler(Handler<Void> handler)
GrpcReadStreamendHandler in interface GrpcReadStream<I>endHandler in interface ReadStream<I>io.grpc.stub.StreamObserver<I> readObserver()
GrpcReadStreamreadObserver in interface GrpcReadStream<I>GrpcBidiExchange<I,O> setReadObserver(io.grpc.stub.StreamObserver<I> observer)
setReadObserver in interface GrpcReadStream<I>io.grpc.stub.StreamObserver<O> writeObserver()
GrpcWriteStreamwriteObserver in interface GrpcWriteStream<O>Copyright © 2021 Eclipse. All rights reserved.