View Source mqtt_sessions_registry (mqtt_sessions v2.3.0)

Registry for all the sessions in a namespace

Link to this section Summary

Functions

Generate a new (random) ClientID of 20 bytes. A ClientID may be 1 to 23 utf8 encoded bytes.
Find the session process for the given pool name and client.
Force a session to close, no DISCONNECT to be sent.
Register a session with the registry, called by the session.
Generate a new (random) RoutingId of 22 bytes. A ClientID may be 1 to 23 utf8 encoded bytes.
Find the name and pool for the session process

Link to this section Functions

-spec client_id(atom()) -> binary().
Generate a new (random) ClientID of 20 bytes. A ClientID may be 1 to 23 utf8 encoded bytes.
Link to this function

code_change(Vsn, State, Extra)

View Source
-spec find_session(atom(), binary() | pid()) -> {ok, pid()} | {error, notfound}.
Find the session process for the given pool name and client.
Link to this function

handle_call(_, From, State)

View Source
-spec init([]) -> {ok, #state{}}.
Link to this function

kill_session(Pool, ClientId)

View Source
-spec kill_session(atom(), binary()) -> ok.
Force a session to close, no DISCONNECT to be sent.
Link to this function

register(Pool, ClientId, Pid)

View Source
-spec register(atom(), binary(), pid()) -> ok | {error, duplicate}.
Register a session with the registry, called by the session.
-spec routing_id(atom()) -> binary().
Generate a new (random) RoutingId of 22 bytes. A ClientID may be 1 to 23 utf8 encoded bytes.
-spec start_link() -> {ok, pid()} | {error, term()}.
Link to this function

terminate(Reason, State)

View Source
-spec whois(pid()) -> {ok, {atom(), binary()}} | {error, notfound}.
Find the name and pool for the session process