Interface StreamResponseHandler<StreamEventType>

Type Parameters:
StreamEventType - The stream event type

public interface StreamResponseHandler<StreamEventType>
Operation response handler is needed to invoke an operation that has a streaming response element to it.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when stream is closed
    boolean
    Called when there's an error in the stream.
    void
    Called when there is a stream event to process
  • Method Details

    • onStreamEvent

      void onStreamEvent(StreamEventType streamEvent)
      Called when there is a stream event to process
      Parameters:
      streamEvent - The stream event to process
    • onStreamError

      boolean onStreamError(Throwable error)
      Called when there's an error in the stream. Return value of this function suggests whether or not the client handling will keep the stream open or close it. There are conditions when onStreamError() may be triggered but the client handling will close the connection anyways.
      Parameters:
      error - The error that occurred
      Returns:
      true if the stream should be closed on this error, false if stream should remain open
    • onStreamClosed

      void onStreamClosed()
      Called when stream is closed