public class SubscriptionQueryStream extends FlowControlledStream<SubscriptionQueryResponse,SubscriptionQueryRequest>
FlowControlledStream implementation to return the results of a SubscriptionQuery.| Constructor and Description |
|---|
SubscriptionQueryStream(String subscriptionQueryId,
CompletableFuture<QueryResponse> initialResultFuture,
String clientId,
int bufferSize,
int fetchSize)
Instantiates a
SubscriptionQueryStream to stream SubscriptionQuery results. |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeStart(io.grpc.stub.ClientCallStreamObserver<SubscriptionQueryRequest> requestStream) |
ResultStream<QueryUpdate> |
buffer()
Returns the
ResultStream buffering the QueryUpdates to this subscription query. |
protected SubscriptionQueryRequest |
buildFlowControlMessage(FlowControl flowControl)
Build a flow control message of type
OUT based on the given flowControl. |
void |
enableFlowControl()
Enables flow control for this stream.
|
void |
onCompleted() |
void |
onError(Throwable t) |
void |
onNext(SubscriptionQueryResponse value) |
buildInitialFlowControlMessage, markConsumed, outboundStreampublic SubscriptionQueryStream(String subscriptionQueryId, CompletableFuture<QueryResponse> initialResultFuture, String clientId, int bufferSize, int fetchSize)
SubscriptionQueryStream to stream SubscriptionQuery results.subscriptionQueryId - the identifier of this subscription queryinitialResultFuture - the initial result of the subscription queryclientId - the identifier of the client initiating the subscription querybufferSize - the size of the update buffer()fetchSize - the number of updates to be consumed prior to refilling the update buffer()public ResultStream<QueryUpdate> buffer()
ResultStream buffering the QueryUpdates to this subscription query.ResultStream buffering the QueryUpdates to this subscription querypublic void onNext(SubscriptionQueryResponse value)
public void onError(Throwable t)
public void onCompleted()
public void beforeStart(io.grpc.stub.ClientCallStreamObserver<SubscriptionQueryRequest> requestStream)
beforeStart in interface io.grpc.stub.ClientResponseObserver<SubscriptionQueryRequest,SubscriptionQueryResponse>beforeStart in class FlowControlledStream<SubscriptionQueryResponse,SubscriptionQueryRequest>public void enableFlowControl()
FlowControlledStream0.enableFlowControl in class FlowControlledStream<SubscriptionQueryResponse,SubscriptionQueryRequest>protected SubscriptionQueryRequest buildFlowControlMessage(FlowControl flowControl)
FlowControlledStreamOUT based on the given flowControl.buildFlowControlMessage in class FlowControlledStream<SubscriptionQueryResponse,SubscriptionQueryRequest>flowControl - the FlowControl message used to base this implementation's flow control message onINCopyright © 2020–2022 AxonIQ BV. All rights reserved.