Class SubscriptionQueryUpdateBuffer
- java.lang.Object
-
- io.axoniq.axonserver.connector.impl.FlowControlledStream<T,R>
-
- io.axoniq.axonserver.connector.impl.FlowControlledBuffer<T,R>
-
- io.axoniq.axonserver.connector.impl.AbstractBufferedStream<QueryUpdate,SubscriptionQueryRequest>
-
- io.axoniq.axonserver.connector.query.impl.SubscriptionQueryUpdateBuffer
-
- All Implemented Interfaces:
ResultStream<QueryUpdate>,io.grpc.stub.ClientResponseObserver<SubscriptionQueryRequest,QueryUpdate>,io.grpc.stub.StreamObserver<QueryUpdate>,AutoCloseable
public class SubscriptionQueryUpdateBuffer extends AbstractBufferedStream<QueryUpdate,SubscriptionQueryRequest>
Buffer forSubscriptionQueryupdates.
-
-
Constructor Summary
Constructors Constructor Description SubscriptionQueryUpdateBuffer(String clientId, String subscriptionQueryId, int bufferSize, int refillBatch)Instantiates aSubscriptionQueryUpdateBuffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SubscriptionQueryRequestbuildFlowControlMessage(FlowControl flowControl)Build a flow control message of typeOUTbased on the givenflowControl.voidclose()Requests the current stream to be closed.voidonCompleted()voidonError(Throwable t)voidonNext(QueryUpdate value)protected QueryUpdateterminalMessage()Builds a terminal message of typeTspecifying when the this stream is closed.-
Methods inherited from class io.axoniq.axonserver.connector.impl.AbstractBufferedStream
getError, isClosed, next, nextIfAvailable, nextIfAvailable, onAvailable, onCloseRequested, peek
-
Methods inherited from class io.axoniq.axonserver.connector.impl.FlowControlledBuffer
beforeStart, getErrorResult, take, tryTake, tryTake, tryTake, tryTakeNow
-
Methods inherited from class io.axoniq.axonserver.connector.impl.FlowControlledStream
buildInitialFlowControlMessage, enableFlowControl, markConsumed, outboundStream
-
-
-
-
Constructor Detail
-
SubscriptionQueryUpdateBuffer
public SubscriptionQueryUpdateBuffer(String clientId, String subscriptionQueryId, int bufferSize, int refillBatch)
Instantiates aSubscriptionQueryUpdateBuffer.- Parameters:
clientId- the identifier of the client initiating the subscription querysubscriptionQueryId- the identifier of the subscription query this buffer buffers forbufferSize- the size of this bufferrefillBatch- the number of updates to be consumed prior to refilling this buffer
-
-
Method Detail
-
terminalMessage
protected QueryUpdate terminalMessage()
Description copied from class:FlowControlledBufferBuilds a terminal message of typeTspecifying when the this stream is closed.- Specified by:
terminalMessagein classFlowControlledBuffer<QueryUpdate,SubscriptionQueryRequest>- Returns:
- a terminal message of type
Tspecifying when the this stream is closed
-
buildFlowControlMessage
protected SubscriptionQueryRequest buildFlowControlMessage(FlowControl flowControl)
Description copied from class:FlowControlledStreamBuild a flow control message of typeOUTbased on the givenflowControl.- Specified by:
buildFlowControlMessagein classFlowControlledStream<QueryUpdate,SubscriptionQueryRequest>- Parameters:
flowControl- theFlowControlmessage used to base this implementation's flow control message on- Returns:
- the message used by this implementation to request new entries of type
IN
-
onNext
public void onNext(QueryUpdate value)
- Specified by:
onNextin interfaceio.grpc.stub.StreamObserver<QueryUpdate>- Overrides:
onNextin classAbstractBufferedStream<QueryUpdate,SubscriptionQueryRequest>
-
onError
public void onError(Throwable t)
- Specified by:
onErrorin interfaceio.grpc.stub.StreamObserver<QueryUpdate>- Overrides:
onErrorin classAbstractBufferedStream<QueryUpdate,SubscriptionQueryRequest>
-
onCompleted
public void onCompleted()
- Specified by:
onCompletedin interfaceio.grpc.stub.StreamObserver<QueryUpdate>- Overrides:
onCompletedin classAbstractBufferedStream<QueryUpdate,SubscriptionQueryRequest>
-
close
public void close()
Description copied from interface:ResultStreamRequests the current stream to be closed. It is up to the publishing end of the stream to honor the request.Any elements received before closing are still available for reading.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResultStream<QueryUpdate>- Overrides:
closein classAbstractBufferedStream<QueryUpdate,SubscriptionQueryRequest>
-
-