Class: Qrack::Queue
- Inherits:
-
Object
- Object
- Qrack::Queue
- Defined in:
- lib/qrack/queue.rb
Overview
Queue ancestor class
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#default_consumer ⇒ AMQ::Client::Consumer
Default consumer (registered with Queue#subscribe).
-
#delivery_tag ⇒ Object
Returns the value of attribute delivery_tag.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#consumer_count ⇒ Object
Returns consumer count from Queue#status.
-
#message_count ⇒ Object
Returns message count from Queue#status.
- #publish(data, opts = {}) ⇒ NilClass deprecated Deprecated.
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
11 12 13 |
# File 'lib/qrack/queue.rb', line 11 def client @client end |
#default_consumer ⇒ AMQ::Client::Consumer
Returns Default consumer (registered with Queue#subscribe).
9 10 11 |
# File 'lib/qrack/queue.rb', line 9 def default_consumer @default_consumer end |
#delivery_tag ⇒ Object
Returns the value of attribute delivery_tag.
13 14 15 |
# File 'lib/qrack/queue.rb', line 13 def delivery_tag @delivery_tag end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/qrack/queue.rb', line 11 def name @name end |
Instance Method Details
#consumer_count ⇒ Object
Returns consumer count from Queue#status.
17 18 19 20 |
# File 'lib/qrack/queue.rb', line 17 def consumer_count s = status s[:consumer_count] end |
#message_count ⇒ Object
Returns message count from Queue#status.
23 24 25 26 |
# File 'lib/qrack/queue.rb', line 23 def s = status s[:message_count] end |
#publish(data, opts = {}) ⇒ NilClass
Deprecated.
Note:
This method will be removed before 0.8 release.
Returns nil.
33 34 35 36 |
# File 'lib/qrack/queue.rb', line 33 def publish(data, opts = {}) Bunny.deprecation_warning("Qrack::Queue#publish", "0.8", "Use direct_exchange = bunny.exchange(''); direct_exchange.publish('message', key: queue.name) if you want to publish directly to one given queue. For more informations see https://github.com/ruby-amqp/bunny/issues/15 and for more theoretical explanation check http://bit.ly/nOF1CK") exchange.publish(data, opts) end |