public class FlowControllingStreamObserver<T> extends Object implements io.grpc.stub.StreamObserver<T>
Constructor and Description |
---|
FlowControllingStreamObserver(io.grpc.stub.StreamObserver<T> wrappedStreamObserver,
AxonServerConfiguration configuration,
Function<FlowControl,T> requestWrapper,
Predicate<T> isConfirmationMessage) |
Modifier and Type | Method and Description |
---|---|
void |
markConsumed(Integer consumed)
notifies the stream observer that [@code consumed} messages are processed by the client.
|
void |
onCompleted() |
void |
onError(Throwable throwable) |
void |
onNext(T t) |
FlowControllingStreamObserver<T> |
sendInitialPermits() |
public FlowControllingStreamObserver(io.grpc.stub.StreamObserver<T> wrappedStreamObserver, AxonServerConfiguration configuration, Function<FlowControl,T> requestWrapper, Predicate<T> isConfirmationMessage)
wrappedStreamObserver
- stream observer to send messages to AxonServerconfiguration
- AxonServer configuration for flow controlrequestWrapper
- Function to create a new permits requestisConfirmationMessage
- predicate to test if the message sent to AxonServer is a confirmation messagepublic FlowControllingStreamObserver<T> sendInitialPermits()
public void onError(Throwable throwable)
onError
in interface io.grpc.stub.StreamObserver<T>
public void onCompleted()
onCompleted
in interface io.grpc.stub.StreamObserver<T>
public void markConsumed(Integer consumed)
consumed
- nr of messages consumedCopyright © 2010–2019. All rights reserved.