Callback behaviour for handling incoming MQTT messages, MQTT 5.0 AUTH challenges, and connection lifecycle events.
If you do not provide a :handler module in ExMqtt.start_link/1, events are
sent as Erlang messages to the :owner process (defaults to the caller of start_link/1):
{:ex_mqtt, client_pid, {:publish, %ExMqtt.Protocol.Packet.Publish{}}}{:ex_mqtt, client_pid, {:connected, %ExMqtt.Protocol.Packet.Connack{}}}{:ex_mqtt, client_pid, {:disconnected, reason}}{:ex_mqtt, client_pid, {:auth, %ExMqtt.Protocol.Packet.Auth{}}}
Summary
Callbacks
@callback handle_auth(ExMqtt.Protocol.Packet.Auth.t(), state :: term()) :: {:ok, new_state :: term()} | {:reply, ExMqtt.Protocol.Packet.Auth.t(), new_state :: term()}
@callback handle_connect(ExMqtt.Protocol.Packet.Connack.t(), state :: term()) :: {:ok, new_state :: term()}
@callback handle_message(ExMqtt.Protocol.Packet.Publish.t(), state :: term()) :: {:ok, new_state :: term()}