off_broadway_mqtt v0.1.0 OffBroadway.MQTT.Queue behaviour View Source
Implemens a inmemory queue to buffer incoming messages for a subscription from a MQTT broker.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Dequeues the demanded amount of messages from the given queue.
Enqueues the message.
Starts a queue with the given name.
Callbacks
Called by the Tortoise.Handler
to enqueue incoming messages.
Called by the producer to dequeue messages.
Called by the producer to start a new queue.
This usually receives a t:MQTT.queue_name/0
as argument.
Link to this section Types
name()
View Source
name() :: OffBroadway.MQTT.queue_name()
name() :: OffBroadway.MQTT.queue_name()
Type for queue_names
Link to this section Functions
child_spec(init_arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor
.
dequeue(queue_name, demand)
View Source
dequeue(name(), non_neg_integer()) :: [any()]
dequeue(name(), non_neg_integer()) :: [any()]
Dequeues the demanded amount of messages from the given queue.
enqueue(queue_name, message) View Source
Enqueues the message.
start_link(args)
View Source
start_link([name() | OffBroadway.MQTT.Config.t() | {atom(), any()}, ...]) ::
GenServer.on_start()
start_link([name() | OffBroadway.MQTT.Config.t() | {atom(), any()}, ...]) :: GenServer.on_start()
Starts a queue with the given name.
Link to this section Callbacks
dequeue(name, non_neg_integer)
View Source
dequeue(name(), non_neg_integer()) :: [any()]
dequeue(name(), non_neg_integer()) :: [any()]
Called by the Tortoise.Handler
to enqueue incoming messages.
enqueue(name, any) View Source
Called by the producer to dequeue messages.
start_link(name)
View Source
start_link(name()) :: GenServer.on_start()
start_link(name()) :: GenServer.on_start()
Called by the producer to start a new queue.
This usually receives a t:MQTT.queue_name/0
as argument.