Copyright © 2018 Marc Worrell
Behaviours: application.
Authors: Marc Worrell (marc@worrell.nl).
callback() = pid() | {module(), atom(), list()}
mqtt_msg() = mqtt_sessions_router:mqtt_msg()
msg_options() = #{transport => pid() | function(), peer_ip => tuple() | undefined, context_prefs => map(), connection_pid => pid()}
session_options() = #{routing_id => binary(), peer_ip => tuple() | undefined, context_prefs => map()}
session_ref() = pid() | binary()
subscriber() = mqtt_sessions_router:subscriber()
subscriber_options() = mqtt_sessions_router:subscriber_options()
topic() = mqtt_packet_map:mqtt_topic()
await_response/1 | |
await_response/2 | |
await_response/3 | |
fetch_queue/1 | |
fetch_queue/2 | |
find_session/1 | |
find_session/2 | |
get_transport/1 | |
get_user_context/1 | |
get_user_context/2 | |
incoming_connect/2 | Stream the connect message - connect a MQTT session or return an error. |
incoming_connect/3 | Stream the connect message - connect a MQTT session or return an error. |
incoming_data/2 | Handle incoming data for session. |
publish/2 | |
publish/3 | |
publish/4 | |
publish/5 | |
router_info/1 | |
runtime/0 | Return the runtime module for AUTH and other callbacks. |
session_count/1 | |
set_runtime/1 | Set the runtime module. |
set_user_context/2 | |
set_user_context/3 | |
sidejobs_limit/0 | Limit the number of sidejobs for message dispatching. |
sidejobs_per_session/0 | |
start/0 | |
start/2 | |
stop/1 | |
subscribe/2 | |
subscribe/3 | |
subscribe/4 | |
subscribe/6 | |
temp_response_topic/1 | |
temp_response_topic/2 | |
unsubscribe/1 | |
unsubscribe/2 | |
unsubscribe/3 | |
update_user_context/2 | |
update_user_context/3 |
await_response(Topic::topic()) -> {ok, mqtt_packet_map:mqtt_message()} | {error, timeout}
await_response(Topic::topic(), Timeout::pos_integer()) -> {ok, mqtt_packet_map:mqtt_message()} | {error, timeout}
await_response(Topic::atom(), Timeout::topic()) -> {ok, mqtt_packet_map:mqtt_message()} | {error, timeout}
await_response(Pool, Topic, Timeout) -> any()
fetch_queue(ClientId::session_ref()) -> {ok, [mqtt_packet_map:mqtt_message() | binary()]} | {error, notfound}
fetch_queue(Pool::atom(), ClientId::session_ref()) -> {ok, [mqtt_packet_map:mqtt_message() | binary()]} | {error, notfound}
find_session(ClientId::session_ref()) -> {ok, pid()} | {error, notfound}
find_session(Pool::atom(), ClientId::session_ref()) -> {ok, pid()} | {error, notfound}
get_transport(SessionPid::pid()) -> {ok, pid()} | {error, notransport | noproc}
get_user_context(ClientId::session_ref()) -> {ok, term()} | {error, notfound | noproc}
get_user_context(Pool::atom(), ClientId::session_ref()) -> {ok, term()} | {error, notfound | noproc}
incoming_connect(MsgBin::binary(), Options::msg_options()) -> {ok, {session_ref(), binary()}} | {error, incomplete_packet} | {error, term()}
Stream the connect message - connect a MQTT session or return an error
incoming_connect(Pool::atom(), MsgBin::binary(), Options::msg_options()) -> {ok, {session_ref(), binary()}} | {error, incomplete_packet} | {error, term()}
Stream the connect message - connect a MQTT session or return an error
incoming_data(SessionRef::session_ref(), MsgBin::binary()) -> ok | {error, wrong_connection | mqtt_packet_map:decode_error()}
Handle incoming data for session. Call this after a successful connect. The session will disconnect on an illegal packet.
publish(Msg::mqtt_packet_map:mqtt_message(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
publish(Pool::topic(), Msg::term(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
publish(Pool::atom(), Msg::mqtt_packet_map:mqtt_message(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
publish(Pool::atom(), Topic::topic(), Payload::term(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
publish(Pool::atom(), Topic::topic(), Payload::term(), Options::map(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
router_info(Pool::atom()) -> list()
runtime() -> atom()
Return the runtime module for AUTH and other callbacks.
session_count(Pool::atom()) -> integer()
set_runtime(Runtime::atom()) -> ok
Set the runtime module
set_user_context(ClientId::session_ref(), UserContext::term()) -> {ok, term()} | {error, notfound | noproc}
set_user_context(Pool::atom(), ClientId::session_ref(), UserContext::term()) -> {ok, term()} | {error, notfound | noproc}
sidejobs_limit() -> pos_integer()
Limit the number of sidejobs for message dispatching.
sidejobs_per_session() -> pos_integer()
start() -> {ok, pid()} | {error, term()}
start(StartType::application:start_type(), StartArgs::term()) -> {ok, pid()} | {error, term()}
stop(State::term()) -> ok
subscribe(TopicFilter::topic(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
subscribe(Pool::atom(), TopicFilter::topic(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
subscribe(Pool::atom(), TopicFilter::topic(), MFA::callback(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
subscribe(Pool::atom(), TopicFilter::topic(), Receiver::callback(), OwnerPid::pid(), Options::map(), UserContext::term()) -> ok | {error, eacces | invalid_topic}
temp_response_topic(UserContext::term()) -> {ok, topic()} | {error, eacces}
temp_response_topic(Pool::atom(), UserContext::term()) -> {ok, topic()} | {error, eacces}
unsubscribe(TopicFilter::topic()) -> ok | {error, notfound | invalid_topic}
unsubscribe(Pool::atom(), TopicFilter::topic()) -> ok | {error, notfound | invalid_topic}
unsubscribe(Pool::atom(), TopicFilter::topic(), OwnerPid::pid()) -> ok | {error, notfound | invalid_topic}
update_user_context(ClientId::session_ref(), Fun::fun((term()) -> term())) -> {ok, term()} | {error, notfound | noproc}
update_user_context(Pool::atom(), ClientId::session_ref(), Fun::fun((term()) -> term())) -> {ok, term()} | {error, notfound | noproc}
Generated by EDoc