View Source WhiteRabbit.Core (White Rabbit v0.2.0)
Contains helper and util functions for the entire WhiteRabbit
library.
Link to this section Summary
Functions
Declare a queue with a dead-letter queue
Get backoff delay from linked agent.
Get the application's default channel. If not available, open another.
Get a random channel from the pool to use.
Setup an exchange with some default args.
Setup of queues for the Consumer. Binds them to exhanges with all the routing_keys
Uses :exchange, :queue, :error_queue
from Genserver args for declaration.
Link to this section Functions
declare_queue(channel, queue, error_queue, exchange, queue_opts, binding_key)
View Source@spec declare_queue( AMQP.Channel.t(), String.t(), String.t(), AMQP.Exchange.t(), Keyword.t(), String.t() ) :: :ok
Declare a queue with a dead-letter queue
@spec get_backoff(Agent.agent()) :: non_neg_integer()
Get backoff delay from linked agent.
@spec get_channel(atom(), atom()) :: {:ok, AMQP.Channel.t()}
Get the application's default channel. If not available, open another.
You can monitor the returned channel for :DOWN events to be able to re-register as a consumer.
@spec get_channel_from_pool(connection_name :: atom(), registry :: atom()) :: {:ok, AMQP.Channel.t()} | {:error, any()}
Get a random channel from the pool to use.
Returns {:ok, AMQP.Channel.t()}
@spec setup_exchange(AMQP.Channel.t(), AMQP.Exchange.t(), atom()) :: :ok
Setup an exchange with some default args.
Setup of queues for the Consumer. Binds them to exhanges with all the routing_keys
Uses :exchange, :queue, :error_queue
from Genserver args for declaration.