SimpleMqtt.Subscriptions (simple_mqtt v0.1.0) View Source
Represents collection of subscribed topics for multiple processes.
Link to this section Summary
Functions
Returns pids for all processes that subscribed to topics that match the given published topic.
Creates new subscriptions collection.
Adds a new subscription to the collection. If the same pid was already registered, the topics will be merged.
Removes topics from the subscription.
Link to this section Types
Specs
subscriptions() :: %{}
Link to this section Functions
Specs
list_matched(subscriptions(), String.t()) :: :error | [pid()]
Returns pids for all processes that subscribed to topics that match the given published topic.
Specs
new() :: subscriptions()
Creates new subscriptions collection.
Specs
subscribe(subscriptions(), pid(), [String.t()]) :: :error | subscriptions()
Adds a new subscription to the collection. If the same pid was already registered, the topics will be merged.
Specs
unsubscribe(subscriptions(), pid(), [String.t()] | :all) :: :error | {:empty, subscriptions()} | {:not_empty, subscriptions()}
Removes topics from the subscription.