Rambla (Rambla v0.15.0) View Source

Interface for the message publishing through Rambla.

Rambla maintains connection pools with a dynamix supervisor. It might be read from the config or passed as a parameter in a call to Rambla.start_pools/1. The latter expects a keyword list of pools to add, each declared with the name of the worker and the options with the following keys:

  • :type the type of the worker; defaults to :local
  • :name the name of the worker; defaults to the module name
  • :options options to be passed to the worker initialization in :poolboy, like [size: 5, max_overflow: 300]
  • :params arguments to be passed to the worker during initialization

In the static configuration (through config/env.exs,) pool options might be given through pool: keyword() parameter.

Link to this section Summary

Functions

Publishes the message to the target pool. The message structure depends on the destination. For RabbitMQ is might be whatever, for Smtp it expects to have to:, subject: and body: fields.

Publishes the message to the target pool, allowing additional options to be set.

Publishes the message to the destination synchronously, avoiding the pool.

Publishes the message to the destination synchronously, avoiding the pool. Unlike publish_synch/2, allows to specify additional options per request.

Executes any arbitrary function in the context of one of workers in the respective connection pool for the target.

Starts the pools configured in the config.exs / releases.exs file.

Starts the pools as specified by options (map() or keyword())

Link to this section Functions

Link to this function

publish(target, message)

View Source

Publishes the message to the target pool. The message structure depends on the destination. For RabbitMQ is might be whatever, for Smtp it expects to have to:, subject: and body: fields.

Link to this function

publish(target, message, opts)

View Source

Publishes the message to the target pool, allowing additional options to be set.

Link to this function

publish_synch(target, message)

View Source

Publishes the message to the destination synchronously, avoiding the pool.

Link to this function

publish_synch(target, message, opts)

View Source

Publishes the message to the destination synchronously, avoiding the pool. Unlike publish_synch/2, allows to specify additional options per request.

Executes any arbitrary function in the context of one of workers in the respective connection pool for the target.

The function would receive a pid of the connection process.

Starts the pools configured in the config.exs / releases.exs file.

This call is equivalent to start_pools(Application.get_env(:rambla, :pools)).

Starts the pools as specified by options (map() or keyword())