freddy v0.10.2 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 a Freddy.Broadcaster process
  • routing_key - message routing key
  • payload - message payload
  • opts - AMQP basic.publish options (see AMQP.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 with the given initial value.

Arguments:

  • mod - the module that defines the server callbacks (like GenServer)
  • conn - the pid of a Hare.Core.Conn process
  • initial - the value that will be given to init/1
  • opts - the GenServer options
Link to this function stop(consumer, reason \\ :normal)