Class UpstreamAwareStreamObserver<ResT>

java.lang.Object
org.axonframework.axonserver.connector.util.UpstreamAwareStreamObserver<ResT>
Type Parameters:
ResT - the type of response sent by the server
All Implemented Interfaces:
io.grpc.stub.ClientResponseObserver<Object,ResT>, io.grpc.stub.StreamObserver<ResT>

public abstract class UpstreamAwareStreamObserver<ResT> extends Object implements io.grpc.stub.ClientResponseObserver<Object,ResT>
Convenience implementation of a StreamObserver that provides access to the request stream, which allows cancellation of the call, flow control, etc.
Since:
4.2
Author:
Allard Buijze
See Also:
  • ClientCallStreamObserver
  • Constructor Details

    • UpstreamAwareStreamObserver

      public UpstreamAwareStreamObserver()
  • Method Details

    • beforeStart

      public void beforeStart(io.grpc.stub.ClientCallStreamObserver<Object> requestStream)
      Specified by:
      beforeStart in interface io.grpc.stub.ClientResponseObserver<Object,ResT>
    • getRequestStream

      public io.grpc.stub.ClientCallStreamObserver<?> getRequestStream()
      Returns the request stream observer which allows interaction with the client stream.
      Returns:
      the request stream observer which allows interaction with the client stream
    • completeRequestStream

      protected void completeRequestStream()
      Completes the request steam related to this stream observer. Ignores exceptions that may occur (for instance if the request stream is already half-closed).