Class: Binpacker::Scheduler
- Inherits:
-
Object
- Object
- Binpacker::Scheduler
- Defined in:
- lib/binpacker/scheduler.rb,
sig/binpacker/scheduler.rbs
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#partition(tests:, worker_count:, timings:) ⇒ Array[Binpacker::WorkerQueue]
Declared on the base so a caller holding a
Schedulercan partition; the base body raises NotImplementedError and every concrete scheduler overrides it.
Class Method Details
.for(strategy) ⇒ Binpacker::LptScheduler, Binpacker::MultifitScheduler
9 10 11 12 13 14 15 16 |
# File 'lib/binpacker/scheduler.rb', line 9 def self.for(strategy) case strategy.to_s when "lpt" then LptScheduler.new when "multifit" then MultifitScheduler.new else raise SchedulerError, "unknown scheduling algorithm: #{strategy}" end end |
Instance Method Details
#partition(tests:, worker_count:, timings:) ⇒ Array[Binpacker::WorkerQueue]
Declared on the base so a caller holding a Scheduler can partition; the base body raises
NotImplementedError and every concrete scheduler overrides it.
7 8 9 |
# File 'sig/binpacker/scheduler.rbs', line 7 def partition(tests:, worker_count:, timings:) raise NotImplementedError end |