Module mqtt_sessions_registry

Registry for all the sessions in a namespace.

Copyright © 2018 Marc Worrell

Behaviours: gen_server.

Authors: Marc Worrell (marc@worrell.nl).

Description

Registry for all the sessions in a namespace

Function Index

client_id/1Generate a new (random) ClientID of 20 bytes.
code_change/3
find_session/2Find the session process for the given pool name and client.
handle_call/3
handle_cast/2
handle_info/2
init/1
kill_session/2Force a session to close, no DISCONNECT to be sent.
register/3Register a session with the registry, called by the session.
routing_id/1Generate a new (random) RoutingId of 22 bytes.
start_link/0
terminate/2
whois/1Find the name and pool for the session process.

Function Details

client_id/1

client_id(Pool::atom()) -> binary()

Generate a new (random) ClientID of 20 bytes. A ClientID may be 1 to 23 utf8 encoded bytes.

code_change/3

code_change(Vsn, State, Extra) -> any()

find_session/2

find_session(Pool::atom(), Pid::binary() | pid()) -> {ok, pid()} | {error, notfound}

Find the session process for the given pool name and client.

handle_call/3

handle_call(X1, From, State) -> any()

handle_cast/2

handle_cast(Cmd, State) -> any()

handle_info/2

handle_info(X1, State) -> any()

init/1

init(X1::[]) -> {ok, #state{}}

kill_session/2

kill_session(Pool::atom(), ClientId::binary()) -> ok

Force a session to close, no DISCONNECT to be sent.

register/3

register(Pool::atom(), ClientId::binary(), Pid::pid()) -> ok | {error, duplicate}

Register a session with the registry, called by the session.

routing_id/1

routing_id(Pool::atom()) -> binary()

Generate a new (random) RoutingId of 22 bytes. A ClientID may be 1 to 23 utf8 encoded bytes.

start_link/0

start_link() -> {ok, pid()} | {error, term()}

terminate/2

terminate(Reason, State) -> any()

whois/1

whois(Pid::pid()) -> {ok, {atom(), binary()}} | {error, notfound}

Find the name and pool for the session process


Generated by EDoc