freddy v0.12.0 Freddy.Notifications.Broadcaster
Freddy.Publisher
special case.
This module allows to publish messages to "freddy-topic"
exchange.
See documentation for Freddy.Publisher
.
Link to this section Summary
Functions
Publish message with the given routing_key
and payload
to "freddy-topic"
exchange.
The message will be encoded to JSON before publication
Starts a Freddy.Broadcaster
process linked to the current process
Link to this section Functions
Link to this function
broadcast(broadcaster, routing_key, payload, opts \\ [])
Publish message with the given routing_key
and payload
to "freddy-topic"
exchange.
The message will be encoded to JSON before publication.
Arguments:
broadcaster
- the pid of aFreddy.Broadcaster
processrouting_key
- message routing keypayload
- message payloadopts
- AMQPbasic.publish
options (seeAMQP.Basic.publish/5
documentation)
Link to this function
call(consumer, message, timeout \\ 5000)
Link to this function
cast(consumer, message)
Link to this function
start_link(mod, conn, initial, opts \\ [])
start_link(module(), GenServer.server(), initial :: term(), GenServer.options()) :: GenServer.on_start()
Starts a Freddy.Broadcaster
process linked to the current process.
The process will be started by calling init/1
with the given initial value.
Arguments:
mod
- the module that defines the server callbacks (likeGenServer
)conn
- the pid of aFreddy.Connection
processinitial
- the value that will be given toinit/1
opts
- theGenServer
options
Link to this function
stop(consumer, reason \\ :normal)