class Puppet::Scheduler::SplayJob

Attributes

splay[R]

Public Class Methods

new(run_interval, splay_limit, &block) click to toggle source
Calls superclass method Puppet::Scheduler::Job::new
  # File lib/puppet/scheduler/splay_job.rb
6 def initialize(run_interval, splay_limit, &block)
7   @splay = calculate_splay(splay_limit)
8   super(run_interval, &block)
9 end

Public Instance Methods

interval_to_next_from(time) click to toggle source
   # File lib/puppet/scheduler/splay_job.rb
11 def interval_to_next_from(time)
12   if last_run
13     super
14   else
15     (start_time + splay) - time
16   end
17 end
ready?(time) click to toggle source
Calls superclass method Puppet::Scheduler::Job#ready?
   # File lib/puppet/scheduler/splay_job.rb
19 def ready?(time)
20   if last_run
21     super
22   else
23     start_time + splay <= time
24   end
25 end

Private Instance Methods

calculate_splay(limit) click to toggle source
   # File lib/puppet/scheduler/splay_job.rb
29 def calculate_splay(limit)
30   rand(limit + 1)
31 end