com.mysql.cj.protocol

## Interface MessageListener<M extends Message>

Type Parameters:
  `M` - Message type

    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

All Methods Instance Methods Abstract Methods Default Methods
`void` `error(Throwable ex)` Exceptionally complete underlying Future.
`default boolean` `processMessage(M message)` Process protocol message.

### Method Detail

#### 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(Throwable ex)

Exceptionally complete underlying Future.

Parameters:
  `ex` - exception to pass to underlying Future.

Copyright © 2016, 2023, Oracle and/or its affiliates.