Class: Puppet::Scheduler::Scheduler

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/scheduler/scheduler.rb

Instance Method Summary collapse

Constructor Details

#initialize(timer = Puppet::Scheduler::Timer.new) ⇒ Scheduler

Returns a new instance of Scheduler.



5
6
7
# File 'lib/puppet/scheduler/scheduler.rb', line 5

def initialize(timer = Puppet::Scheduler::Timer.new)
  @timer = timer
end

Instance Method Details

#run_loop(jobs) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/puppet/scheduler/scheduler.rb', line 9

def run_loop(jobs)
  mark_start_times(jobs, @timer.now)
  until enabled(jobs).empty?
    @timer.wait_for(min_interval_to_next_run_from(jobs, @timer.now))
    run_ready(jobs, @timer.now)
  end
end