ExRabbitMQ v2.4.1 ExRabbitMQ.Connection View Source

A GenServer implementing a long running connection to a RabbitMQ server, with embedded PubSub using :pg2 and :ets.

Link to this section Summary

Functions

Gracefully closes the RabbitMQ connection and terminates its GenServer handler identified by connection_pid

Checks whether this process holds a usable connection to RabbitMQ

Subscribes a consumer process, via self(), to the managed ETS table

Link to this section Functions

Link to this function close(connection_pid) View Source
close(pid) :: :ok

Gracefully closes the RabbitMQ connection and terminates its GenServer handler identified by connection_pid.

Link to this function get(connection_pid) View Source
get(pid) :: true | false | {:error, any}

Checks whether this process holds a usable connection to RabbitMQ.

connection_pid is the GenServer pid implementing the called ExRabbitMQ.Connection)

Link to this function subscribe(connection_pid, connection_config) View Source
subscribe(pid, term) :: true | false

Subscribes a consumer process, via self(), to the managed ETS table.

If the ETS table already contains 65535 consumers, and thus the maximum allowed 65535 channels, then the subscription is not allowed so that a new connection can be created.

connection_pid is the GenServer pid implementing the called ExRabbitMQ.Connection

connection_config is the connection config that the ExRabbitMQ.Connection has to be using in order to allow the subscription