EmqttFailover.ConnectionHandler behaviour (EmqttFailover v0.3.0)

Behavior for handling messages in an EmqttFailover.Connection.

Summary

Types

@type state() :: term()

Callbacks

Link to this callback

handle_connected(state)

@callback handle_connected(state()) ::
  {:ok, Enumerable.t(EmqttFailover.Message.topic()), state()}
Link to this callback

handle_disconnected(reason, state)

@callback handle_disconnected(reason :: term(), state()) :: {:ok, state()}
Link to this callback

handle_message(t, state)

@callback handle_message(EmqttFailover.Message.t(), state()) :: {:ok, state()}
@callback init(term()) :: {:ok, state()}