http://rdoc.info/github/ruby-amqp/bunny/Bunny/Queue
Class: Bunny::Queue
- Inherits:
- Object show all
- Defined in:
- lib/bunny/queue.rb
Overview
Represents AMQP 0.9.1 queue.
Instance Attribute Summary (collapse)
- - (Bunny::Channel) channel readonly
Channel this queue uses.
- - (String) name readonly
Queue name.
- - (Hash) options readonly
Options this queue was created with.
Instance Method Summary (collapse)
- - (Hash) arguments
Additional optional arguments (typically used by RabbitMQ extensions and plugins).
- - (Boolean) auto_delete?
True if this queue was declared as automatically deleted (deleted as soon as last consumer unbinds).
- - (Object) bind(exchange, opts = {})
Binds queue to an exchange.
- - (Integer) consumer_count
How many active consumers the queue has.
- - (Object) delete(opts = {})
Deletes the queue.
- - (Boolean) durable?
True if this queue was declared as durable (will survive broker restart).
- - (Boolean) exclusive?
True if this queue was declared as exclusive (limited to just one consumer).
- - (Queue) initialize(channel_or_connection, name = AMQ::Protocol::EMPTY_STRING, opts = {}) constructor
A new instance of Queue.
- - (Integer) message_count
How many messages the queue has ready (e.g. not delivered but not unacknowledged).
- - (Array) pop(opts = {:manual_ack => false}, &block) (also: #get)
Triple of delivery info, message properties and message content.
- - (Object) publish(payload, opts = {})
Publishes a message to the queue via default exchange.
- - (Object) purge(opts = {})
Purges a queue (removes all messages from it).
- - (Boolean) server_named?
True if this queue was declared as server named.
- - (Hash) status
A hash with information about the number of queue messages and consumers.
- - (Object) subscribe(opts = { :consumer_tag => @channel.generate_consumer_tag, :manual_ack => false, :exclusive => false, :block => false, :on_cancellation => nil }, &block)
Adds a consumer to the queue (subscribes for message deliveries).
- - (Object) subscribe_with(consumer, opts = {:block => false})
Adds a consumer object to the queue (subscribes for message deliveries).
- - (Object) unbind(exchange, opts = {})
Unbinds queue from an exchange.
Constructor Details
permalink - (Queue) initialize(channel_or_connection, name = AMQ::Protocol::EMPTY_STRING, opts = {})
Returns a new instance of Queue
Instance Attribute Details
permalink - (Bunny::Channel) channel (readonly)
[View on GitHub]permalink - (String) name (readonly)
[View on GitHub]permalink - (Hash) options (readonly)
[View on GitHub]Instance Method Details
permalink - (Hash) arguments
Returns Additional optional arguments (typically used by RabbitMQ extensions and plugins)
- (Boolean) auto_delete?
Returns true if this queue was declared as automatically deleted (deleted as soon as last consumer unbinds).
permalink - (Object) bind(exchange, opts = {})
Binds queue to an exchange
permalink - (Integer) consumer_count
[View source] [View on GitHub]- (Boolean) durable?
Returns true if this queue was declared as durable (will survive broker restart).
- (Boolean) exclusive?
Returns true if this queue was declared as exclusive (limited to just one consumer)
permalink - (Integer) message_count
[View source] [View on GitHub]permalink - (Array) pop(opts = {:manual_ack => false}, &block) Also known as: get
Returns Triple of delivery info, message properties and message content. If the queue is empty, all three will be nils.
permalink - (Object) publish(payload, opts = {})
Publishes a message to the queue via default exchange. Takes the same arguments as Exchange#publish
permalink - (Object) purge(opts = {})
Purges a queue (removes all messages from it)
- (Boolean) server_named?
Returns true if this queue was declared as server named.
permalink - (Hash) status
Returns A hash with information about the number of queue messages and consumers
permalink - (Object) subscribe(opts = { :consumer_tag => @channel.generate_consumer_tag, :manual_ack => false, :exclusive => false, :block => false, :on_cancellation => nil }, &block)
Adds a consumer to the queue (subscribes for message deliveries).
permalink - (Object) subscribe_with(consumer, opts = {:block => false})
Adds a consumer object to the queue (subscribes for message deliveries).
permalink - (Object) unbind(exchange, opts = {})
Unbinds queue from an exchange