Class SynchronizedRequestStream<T>
- java.lang.Object
-
- io.grpc.stub.CallStreamObserver<ReqT>
-
- io.grpc.stub.ClientCallStreamObserver<T>
-
- io.axoniq.axonserver.connector.impl.SynchronizedRequestStream<T>
-
- Type Parameters:
T- the type of value returned by this stream
- All Implemented Interfaces:
io.grpc.stub.StreamObserver<T>
public class SynchronizedRequestStream<T> extends io.grpc.stub.ClientCallStreamObserver<T>Lock-based synchronized implementation of aClientCallStreamObserver. Acts as a wrapper of anotherClientCallStreamObserver, to which all of operations will be delegated, adding synchronization logic toonNext(Object),onCompleted()andonError(Throwable).
-
-
Constructor Summary
Constructors Constructor Description SynchronizedRequestStream(io.grpc.stub.ClientCallStreamObserver<T> requestStream)Instantiate aSynchronizedRequestStream, delegating all operations to the givenrequestStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel(String message, Throwable cause)voiddisableAutoInboundFlowControl()voiddisableAutoRequestWithInitial(int request)booleanisReady()voidonCompleted()voidonError(Throwable t)voidonNext(T value)voidrequest(int count)voidsetMessageCompression(boolean enable)voidsetOnReadyHandler(Runnable onReadyHandler)
-
-
-
Constructor Detail
-
SynchronizedRequestStream
public SynchronizedRequestStream(io.grpc.stub.ClientCallStreamObserver<T> requestStream)
Instantiate aSynchronizedRequestStream, delegating all operations to the givenrequestStream- Parameters:
requestStream- theClientCallStreamObserverto delegate method invocations to
-
-
Method Detail
-
cancel
public void cancel(String message, Throwable cause)
- Specified by:
cancelin classio.grpc.stub.ClientCallStreamObserver<T>
-
isReady
public boolean isReady()
- Specified by:
isReadyin classio.grpc.stub.ClientCallStreamObserver<T>
-
setOnReadyHandler
public void setOnReadyHandler(Runnable onReadyHandler)
- Specified by:
setOnReadyHandlerin classio.grpc.stub.ClientCallStreamObserver<T>
-
disableAutoInboundFlowControl
public void disableAutoInboundFlowControl()
- Specified by:
disableAutoInboundFlowControlin classio.grpc.stub.CallStreamObserver<T>
-
request
public void request(int count)
- Specified by:
requestin classio.grpc.stub.ClientCallStreamObserver<T>
-
setMessageCompression
public void setMessageCompression(boolean enable)
- Specified by:
setMessageCompressionin classio.grpc.stub.ClientCallStreamObserver<T>
-
onNext
public void onNext(T value)
-
disableAutoRequestWithInitial
public void disableAutoRequestWithInitial(int request)
- Overrides:
disableAutoRequestWithInitialin classio.grpc.stub.ClientCallStreamObserver<T>
-
onError
public void onError(Throwable t)
-
onCompleted
public void onCompleted()
-
-