Class: Contrek::Concurrent::StreamingMerger
- Inherits:
-
VerticalMerger
- Object
- Finder
- Merger
- VerticalMerger
- Contrek::Concurrent::StreamingMerger
- Defined in:
- lib/contrek/finder/concurrent/streaming_merger.rb
Instance Attribute Summary
Attributes inherited from Merger
Attributes included from Poolable
Attributes inherited from Finder
Instance Method Summary collapse
- #add_tile(result, flush = false) ⇒ Object
-
#initialize(stream_to:, total_width:, total_height:, options: {}) ⇒ StreamingMerger
constructor
A new instance of StreamingMerger.
- #process_info ⇒ Object
Methods included from Poolable
Constructor Details
#initialize(stream_to:, total_width:, total_height:, options: {}) ⇒ StreamingMerger
Returns a new instance of StreamingMerger.
6 7 8 9 10 11 12 |
# File 'lib/contrek/finder/concurrent/streaming_merger.rb', line 6 def initialize(stream_to:, total_width:, total_height:, options: {}) @stream = stream_to @total_width = total_width @total_height = total_height @moved = 0 super(options: ) end |
Instance Method Details
#add_tile(result, flush = false) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/contrek/finder/concurrent/streaming_merger.rb', line 14 def add_tile(result, flush = false) super(result) if @tiles.size == 2 process_tiles!(nil, height: @height) @tiles << @whole_tile stream_polygons!(@whole_tile, flush) end end |
#process_info ⇒ Object
24 25 26 27 28 |
# File 'lib/contrek/finder/concurrent/streaming_merger.rb', line 24 def process_info result = super result.[:groups] = @moved result end |