subscribex v0.9.0 Subscribex.Broker

Defines a Broker.

The broker expects the :otp_app as an option. The :otp_app should point to an OTP application that has the broker configuration. For example, the broker:

defmodule Broker do
  use Subscribex.Broker, otp_app: :my_app
end

Could be configured with:

config :my_app, Broker,
  host: "localhost",
  username: "guest",
  password: "guest",
  port: 5672

URLs

Brokers by default support URLs. For example, the configuration above could be rewritten to:

config :my_app, Broker,
  url: "amqp://guest:guest@localhost:5672"

Summary

Types

callback_return :: term
channel :: %AMQP.Channel{conn: term, pid: term}
delivery_tag :: term
t :: module

Functions

apply_link(channel, atom)
do_channel(connection_pid, link, module)
publish(channel, exchange, routing_key, payload, options \\ [])

Specs

publish(channel, String.t, String.t, binary, keyword) ::
  :ok |
  :blocked |
  :closing
sanitize_host(host)

Specs

sanitize_host(String.t | Keyword.t) :: Keyword.t
sanitize_host(username, password, host, port)

Specs

sanitize_host(String.t, String.t, String.t | charlist, String.t | integer) :: Keyword.t
subscriber_spec(subscriber)