Class: QC::Queue
- Inherits:
-
Object
- Object
- QC::Queue
- Defined in:
- lib/queue_classic/queue.rb
Instance Attribute Summary collapse
-
#chan ⇒ Object
readonly
Returns the value of attribute chan.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #count ⇒ Object
- #delete(id) ⇒ Object
- #delete_all ⇒ Object
- #enqueue(method, *args) ⇒ Object
-
#initialize(name, notify = false) ⇒ Queue
constructor
A new instance of Queue.
- #lock(top_bound = TOP_BOUND) ⇒ Object
Constructor Details
#initialize(name, notify = false) ⇒ Queue
Returns a new instance of Queue.
6 7 8 9 |
# File 'lib/queue_classic/queue.rb', line 6 def initialize(name, notify=false) @name = name @chan = @name if notify end |
Instance Attribute Details
#chan ⇒ Object (readonly)
Returns the value of attribute chan.
4 5 6 |
# File 'lib/queue_classic/queue.rb', line 4 def chan @chan end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/queue_classic/queue.rb', line 4 def name @name end |
Instance Method Details
#count ⇒ Object
27 28 29 |
# File 'lib/queue_classic/queue.rb', line 27 def count Queries.count(name) end |
#delete(id) ⇒ Object
19 20 21 |
# File 'lib/queue_classic/queue.rb', line 19 def delete(id) Queries.delete(id) end |
#delete_all ⇒ Object
23 24 25 |
# File 'lib/queue_classic/queue.rb', line 23 def delete_all Queries.delete_all(name) end |