exmqttc v0.4.1 Exmqttc.Callback behaviour

Behaviour module for Exmqttc callbacks

Link to this section Summary

Callbacks

Called if the connection process or the callback handler process receive unknown handle_call/3 calls

Called if the connection process or the callback handler process receive unknown handle_cast/2 calls

Called once a connection has been established

Called on disconnection from the broker

Called if the connection process or the callback handler process receive unknown handle_info/2 calls, and by extend also unknown Elixir messages

Called upon reception of a MQTT message, passes in topic and message

Initializing the callback module, returned data is passed in as state on the next call

Link to this section Callbacks

Link to this callback handle_call(message, from, state)
handle_call(message :: term, from :: {pid, atom}, state :: term) :: {:ok, state :: term}

Called if the connection process or the callback handler process receive unknown handle_call/3 calls.

Link to this callback handle_cast(message, state)
handle_cast(message :: term, state :: term) :: {:ok, state :: term} :: {:ok, state :: term}

Called if the connection process or the callback handler process receive unknown handle_cast/2 calls.

Link to this callback handle_connect(state)
handle_connect(state :: any) :: {:ok, state :: any}

Called once a connection has been established.

Link to this callback handle_disconnect(state)
handle_disconnect(state :: any) :: {:ok, state :: any}

Called on disconnection from the broker.

Link to this callback handle_info(message, state)
handle_info(message :: term, state :: term) :: {:ok, state :: term} :: {:ok, state :: term}

Called if the connection process or the callback handler process receive unknown handle_info/2 calls, and by extend also unknown Elixir messages.

Link to this callback handle_publish(topic, message, state)
handle_publish(topic :: String.t, message :: String.t, state :: any) :: {:ok, state :: any}

Called upon reception of a MQTT message, passes in topic and message.

Link to this callback init()
init() :: {:ok, state :: any}

Initializing the callback module, returned data is passed in as state on the next call.