View Source mqtt_sessions_will (mqtt_sessions v2.8.0)

Watchdog process, publishes the will and kills the session if it disconnected too long or crashes. The timeout till the session is killed is either the (default) session expiry from mqtt_sessions_process or the expiry interval set in the options of the will message. Periodically the sessions process is polled to see if it is still connected, this is done to prevent any missed disconnect events from the sessions process.

Summary

Functions

Link to this function

code_change(Vsn, State, Extra)

View Source
Link to this function

connected(Pid, Will, SessionExpiry, UserContext)

View Source
-spec connected(pid(), map() | undefined, non_neg_integer(), term()) -> ok.
-spec disconnected(pid()) -> ok.
Link to this function

disconnected(Pid, IsWill, ExpiryInterval)

View Source
-spec disconnected(pid() | undefined, boolean(), non_neg_integer()) -> ok.

Signal the will process that the session got disconnected from the client.

Link to this function

handle_call(Msg, From, State)

View Source
-spec reconnected(pid()) -> ok.
Link to this function

set_user_context(Pid, UserContext)

View Source
-spec set_user_context(pid(), term()) -> ok.

Set a new user context, needed after reauthentication

Link to this function

start_link(Pool, SessionPid)

View Source
-spec start_link(atom(), pid()) -> {ok, pid()}.
-spec stop(pid() | undefined) -> ok.

Sync request to stop the will process

Link to this function

terminate(Reason, State)

View Source