Module mqtt_sessions_router

Process owning the MQTT topic router.

Copyright © 2018-2020 Marc Worrell

Behaviours: gen_server.

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

Description

Process owning the MQTT topic router.

Data Types

mqtt_msg()

mqtt_msg() = #{pool => atom(), topic => [binary()], topic_bindings => [proplists:property()], message => mqtt_packet_map:mqtt_message(), publisher_context => term(), subscriber_context => term(), no_local => boolean(), qos => 0 | 1 | 2, retain_as_published => boolean(), retain_handling => integer()}

subscriber()

subscriber() = {pid() | mfa(), OwnerPid::pid(), subscriber_options()}

subscriber_options()

subscriber_options() = #{subscriber_context => term(), no_local => boolean(), qos => 0 | 1 | 2, retain_as_published => boolean(), retain_handling => integer()}

Function Index

code_change/3
handle_call/3
handle_cast/2
handle_info/2
info/1
init/1
name/1
publish/3
publish/4
start_link/1
subscribe/4
subscribe/6
terminate/2
unsubscribe/3
unsubscribe_pid/2

Function Details

code_change/3

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

handle_call/3

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

handle_cast/2

handle_cast(Cmd, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

info/1

info(Pool::atom()) -> list()

init/1

init(X1::[atom()]) -> {ok, #state{pool = atom(), router = router:router(), monitors = map()}}

name/1

name(Pool::atom()) -> atom()

publish/3

publish(Pool::atom(), Topic::list(), Msg::mqtt_packet_map:mqtt_message()) -> {ok, pid() | undefined} | {error, overload}

publish/4

publish(Pool::atom(), Topic0::list(), Msg::mqtt_packet_map:mqtt_message(), PublisherContext::term()) -> {ok, pid() | undefined} | {error, overload}

start_link/1

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

subscribe/4

subscribe(Pool::atom(), Topic::list(), MFA::mqtt_sessions:callback(), SubscriberContext::term()) -> ok | {error, invalid_subscriber}

subscribe/6

subscribe(Pool, TopicFilter, Subscriber, OwnerPid, Options, SubscriberContext) -> any()

terminate/2

terminate(Reason, State) -> any()

unsubscribe/3

unsubscribe(Pool::atom(), TopicFilter::list(), Pid::pid()) -> ok | {error, notfound}

unsubscribe_pid/2

unsubscribe_pid(Pool::atom(), Pid::pid()) -> ok


Generated by EDoc