Class: Tap::Support::Joins::Merge

Inherits:
ReverseJoin show all
Defined in:
lib/tap/support/joins/merge.rb

Overview

Merge (or simple merge) passes the results of each source to the target without synchronization.

Constant Summary

Constants inherited from Tap::Support::Join

Tap::Support::Join::FLAGS, Tap::Support::Join::SHORT_FLAGS

Instance Method Summary collapse

Methods inherited from ReverseJoin

#inspect, join

Methods inherited from Tap::Support::Join

#initialize, #inspect, join, #name, #options

Constructor Details

This class inherits a constructor from Tap::Support::Join

Instance Method Details

#join(target, sources) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/tap/support/joins/merge.rb', line 8

def join(target, sources)
  sources.each do |source|
    # merging can use the existing audit trails... each distinct 
    # input is getting sent to one place (the target)
    complete(source) do |_result| 
      yield(_result) if block_given?
      enq(target, _result)
    end
  end
end