Class: Bonito::ParallelScheduler
- Defined in:
- lib/bonito/parallel_timeline.rb
Overview
:nodoc:
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(parallel, starting_offset, scope, opts = {}) ⇒ ParallelScheduler
constructor
A new instance of ParallelScheduler.
Constructor Details
#initialize(parallel, starting_offset, scope, opts = {}) ⇒ ParallelScheduler
Returns a new instance of ParallelScheduler.
9 10 11 12 13 14 15 |
# File 'lib/bonito/parallel_timeline.rb', line 9 def initialize(parallel, starting_offset, scope, opts = {}) super @schedulers = parallel.map do |timeline| timeline.schedule(starting_offset, scope, opts).to_enum end @heap = LazyMinHeap.new(*@schedulers) end |
Instance Method Details
#each ⇒ Object
17 18 19 |
# File 'lib/bonito/parallel_timeline.rb', line 17 def each @heap.each { |moment| yield moment } end |