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


3
4
5
# File 'lib/puppet/scheduler/scheduler.rb', line 3

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

Instance Method Details

#run_loop(jobs) ⇒ Object


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

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