IN - the type of entries returned by this streamOUT - the type of message used for flow control in this streampublic abstract class FlowControlledStream<IN,OUT> extends Object implements io.grpc.stub.ClientResponseObserver<OUT,IN>
ClientResponseObserver providing flow control.| Modifier | Constructor and Description |
|---|---|
protected |
FlowControlledStream(String clientId,
int permits,
int refillBatch)
Constructs a
FlowControlledStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeStart(io.grpc.stub.ClientCallStreamObserver<OUT> requestStream) |
protected abstract OUT |
buildFlowControlMessage(FlowControl flowControl)
Build a flow control message of type
OUT based on the given flowControl. |
protected OUT |
buildInitialFlowControlMessage(FlowControl flowControl)
Builds the initial flow control message of type
OUT based on the given flowControl. |
void |
enableFlowControl()
Enables flow control for this stream.
|
protected void |
markConsumed()
Notifier when an entry has been consumed from this stream.
|
protected io.grpc.stub.ClientCallStreamObserver<OUT> |
outboundStream()
Return the
ClientCallStreamObserver serving as the outbound stream. |
protected FlowControlledStream(String clientId, int permits, int refillBatch)
FlowControlledStream.clientId - the client identifier which initiated this streampermits - the number of permits this stream should receiverefillBatch - the number of permits to be consumed prior to requesting new permitspublic void enableFlowControl()
0.protected abstract OUT buildFlowControlMessage(FlowControl flowControl)
OUT based on the given flowControl.flowControl - the FlowControl message used to base this implementation's flow control message onINprotected OUT buildInitialFlowControlMessage(FlowControl flowControl)
OUT based on the given flowControl.flowControl - the FlowControl message used to base this implementation's flow control message onINprotected void markConsumed()
permitsBatch size has been reached.public void beforeStart(io.grpc.stub.ClientCallStreamObserver<OUT> requestStream)
protected io.grpc.stub.ClientCallStreamObserver<OUT> outboundStream()
ClientCallStreamObserver serving as the outbound stream. Can be used to send additional
messages required to tap into the flow control of this stream, or the complete the stream altogether.ClientCallStreamObserver serving as the outbound streamCopyright © 2020–2022 AxonIQ BV. All rights reserved.