Class: BugBunny::Queue
- Inherits:
-
Object
- Object
- BugBunny::Queue
- Defined in:
- lib/bug_bunny/queue.rb
Instance Attribute Summary collapse
-
#auto_delete ⇒ Object
Returns the value of attribute auto_delete.
-
#durable ⇒ Object
Returns the value of attribute durable.
-
#exclusive ⇒ Object
Returns the value of attribute exclusive.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rabbit_queue ⇒ Object
Returns the value of attribute rabbit_queue.
Instance Method Summary collapse
- #check_consumers ⇒ Object
-
#initialize(attrs = {}) ⇒ Queue
constructor
A new instance of Queue.
- #options ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Queue
Returns a new instance of Queue.
5 6 7 8 9 10 11 |
# File 'lib/bug_bunny/queue.rb', line 5 def initialize(attrs={}) # "Real" queue opts @name = attrs.fetch(:name, 'undefined') @auto_delete = attrs.fetch(:auto_delete, true) @durable = attrs.fetch(:durable, false) @exclusive = attrs.fetch(:exclusive, false) end |
Instance Attribute Details
#auto_delete ⇒ Object
Returns the value of attribute auto_delete.
3 4 5 |
# File 'lib/bug_bunny/queue.rb', line 3 def auto_delete @auto_delete end |
#durable ⇒ Object
Returns the value of attribute durable.
3 4 5 |
# File 'lib/bug_bunny/queue.rb', line 3 def durable @durable end |
#exclusive ⇒ Object
Returns the value of attribute exclusive.
3 4 5 |
# File 'lib/bug_bunny/queue.rb', line 3 def exclusive @exclusive end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/bug_bunny/queue.rb', line 3 def name @name end |
#rabbit_queue ⇒ Object
Returns the value of attribute rabbit_queue.
3 4 5 |
# File 'lib/bug_bunny/queue.rb', line 3 def rabbit_queue @rabbit_queue end |
Instance Method Details
#check_consumers ⇒ Object
17 18 19 20 21 |
# File 'lib/bug_bunny/queue.rb', line 17 def check_consumers rabbit_queue.consumer_count rescue StandardError 0 end |
#options ⇒ Object
13 14 15 |
# File 'lib/bug_bunny/queue.rb', line 13 def { durable: durable, exclusive: exclusive, auto_delete: auto_delete } end |