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 = QC::LISTENING_WORKER) ⇒ Queue
constructor
A new instance of Queue.
- #lock(top_bound = TOP_BOUND) ⇒ Object
Constructor Details
#initialize(name, notify = QC::LISTENING_WORKER) ⇒ Queue
Returns a new instance of Queue.
5 6 7 8 |
# File 'lib/queue_classic/queue.rb', line 5 def initialize(name, notify=QC::LISTENING_WORKER) @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
26 27 28 |
# File 'lib/queue_classic/queue.rb', line 26 def count Queries.count(name) end |
#delete(id) ⇒ Object
18 19 20 |
# File 'lib/queue_classic/queue.rb', line 18 def delete(id) Queries.delete(id) end |
#delete_all ⇒ Object
22 23 24 |
# File 'lib/queue_classic/queue.rb', line 22 def delete_all Queries.delete_all(name) end |