Interface MessageListener<M extends Message>

Type Parameters:
M - Message type
All Known Implementing Classes:
ResultMessageListener

public interface MessageListener<M extends Message>
Sink for messages that are read asynchonously from the socket. Return whether the listener is done receiving messages.
  • Method Summary

    Modifier and Type Method Description
    void error​(java.lang.Throwable ex)
    Exceptionally complete underlying Future.
    default boolean processMessage​(M message)
    Process protocol message.
  • Method Details

    • processMessage

      default boolean processMessage​(M message)
      Process protocol message.
      Parameters:
      message - Message instance
      Returns:
      true - if this listener is done with processing the messages sequence and may be discarded; false - if the next message must be dispatched to the same listener
    • error

      void error​(java.lang.Throwable ex)
      Exceptionally complete underlying Future.
      Parameters:
      ex - exception to pass to underlying Future.