View Source ExRabbitPool (ex_rabbit_pool v1.1.0)
Link to this section Summary
Functions
Puts back a RabbitMQ channel into its corresponding connection worker
Gets a RabbitMQ channel out of a connection worker
Gets a connection from a connection worker so any client can exec commands manually
Retrieve a connection worker - we don't care about isolating access to each worker - we use a pool purely in order to spread load (pool config strategy :fifo)
Executes function f in the context of a channel, takes a connection worker out of the pool, put that connection worker back into the pool so any other concurrent client can have access to it, checks out a channel out of the worker's channel pool, executes the function with the result of the checkout and finally puts the channel back into the worker's pool.
Link to this section Types
@type f() :: ({:ok, AMQP.Channel.t()} | {:error, :disconnected | :out_of_channels} -> any())
Link to this section Functions
@spec checkin_channel(pid(), AMQP.Channel.t()) :: :ok
Puts back a RabbitMQ channel into its corresponding connection worker
@spec checkout_channel(pid()) :: {:ok, AMQP.Channel.t()} | {:error, :disconnected | :out_of_channels}
Gets a RabbitMQ channel out of a connection worker
create_queue_with_bind(adapter, pool_id, queue, exchange, options \\ [])
View Source@spec create_queue_with_bind( module(), atom(), AMQP.Basic.queue(), AMQP.Basic.exchange(), keyword() ) :: :ok | AMQP.Basic.error() | {:error, any()}
@spec get_connection(atom()) :: {:ok, AMQP.Connection.t()} | {:error, :disconnected}
Gets a connection from a connection worker so any client can exec commands manually
Retrieve a connection worker - we don't care about isolating access to each worker - we use a pool purely in order to spread load (pool config strategy :fifo)
Executes function f in the context of a channel, takes a connection worker out of the pool, put that connection worker back into the pool so any other concurrent client can have access to it, checks out a channel out of the worker's channel pool, executes the function with the result of the checkout and finally puts the channel back into the worker's pool.