wabbit v0.4.0 Wabbit.Queue View Source

Functions to operate on Queues.

Link to this section Summary

Functions

Binds a Queue to an Exchange

Returns a number of active consumers on the queue

Deletes a Queue by name

Returns true if queue is empty (has no messages ready), false otherwise

Returns the number of messages that are ready for delivery (e.g. not pending acknowledgements) in the queue

Discards all messages in the Queue

Returns the message count and consumer count for the given queue

Unbinds a Queue from an Exchange

Link to this section Functions

Link to this function bind(channel, queue, exchange, options \\ []) View Source

Binds a Queue to an Exchange

The following options can be used:

Options

  • :routing_key - If set, specifies the routing key for the binding
  • :no_wait - If set, the server will not respond to the method
  • :arguments - A set of arguments for the binding
Link to this function consumer_count(channel, queue) View Source

Returns a number of active consumers on the queue

Link to this function declare(channel, queue \\ "", options \\ []) View Source

Declares a queue.

The optional queue parameter is used to set the name. If set to an empty string (default), the server will assign a name. Besides the queue name, the following options can be used:

Options

  • :durable - If set, keeps the Queue between restarts of the broker
  • :auto_delete - If set, deletes the Queue once all subscribers disconnect
  • :exclusive - If set, only one subscriber can consume from the Queue
  • :passive - If set, raises an error unless the queue already exists
  • :no_wait - If set, the server will not respond to the method
  • :arguments - A set of arguments for the declaration
Link to this function delete(channel, queue, options \\ []) View Source

Deletes a Queue by name

The following options can be used:

Options

  • :if_unused - If set, the server will only delete the queue if it has no consumers
  • :if_empty - If set, the server will only delete the queue if it has no messages
  • :no_wait - If set, the server will not respond to the method

Returns true if queue is empty (has no messages ready), false otherwise

Link to this function message_count(channel, queue) View Source

Returns the number of messages that are ready for delivery (e.g. not pending acknowledgements) in the queue

Discards all messages in the Queue

Returns the message count and consumer count for the given queue.

Uses Queue.declare with the passive option set.

Link to this function unbind(channel, queue, exchange, options \\ []) View Source

Unbinds a Queue from an Exchange

The following options can be used:

Options

  • :routing_key - If set, specifies the routing key for the unbind
  • :arguments - A set of arguments for the unbind