Class: Peons::Queue
- Inherits:
-
Nest
- Object
- Nest
- Peons::Queue
- Defined in:
- lib/peons.rb
Instance Method Summary collapse
Instance Method Details
#backup ⇒ Object
30 31 32 |
# File 'lib/peons.rb', line 30 def backup self[Process.pid][:backup] end |
#each ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/peons.rb', line 22 def each catch :empty do loop do pop! { |e| yield e } end end end |
#errors ⇒ Object
34 35 36 |
# File 'lib/peons.rb', line 34 def errors self[:errors] end |
#pop ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/peons.rb', line 10 def pop return unless item = rpoplpush(backup) begin yield item rescue Exception => e fail(e, item) ensure backup.del end end |