Method: Rinda::TupleBag#delete_unless_alive
- Defined in:
- lib/rinda/tuplespace.rb
#delete_unless_alive ⇒ Object
Delete tuples which dead tuples from the TupleBag, returning the deleted tuples.
381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/rinda/tuplespace.rb', line 381 def delete_unless_alive deleted = [] @hash.each do |key, bin| bin.delete_if do |tuple| if tuple.alive? false else deleted.push(tuple) true end end end deleted end |