Method: OFlow::Actors::Merger#perform

Defined in:
lib/oflow/actors/merger.rb

#perform(op, box) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/oflow/actors/merger.rb', line 15

def perform(op, box)
  matches = match(box)
  if matches.nil?
    waiting_add(box)
  else
    matches.each { |b| waiting_remove(b) }
    matches << box
    box = merge(matches)
    task.ship(nil, box)
  end
end