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 5 def initialize(run_interval, splay_limit, &block) 6 @splay = calculate_splay(splay_limit) 7 super(run_interval, &block) 8 end
Public Instance Methods
interval_to_next_from(time)
click to toggle source
Calls superclass method
Puppet::Scheduler::Job#interval_to_next_from
# File lib/puppet/scheduler/splay_job.rb 10 def interval_to_next_from(time) 11 if last_run 12 super 13 else 14 (start_time + splay) - time 15 end 16 end
ready?(time)
click to toggle source
Calls superclass method
Puppet::Scheduler::Job#ready?
# File lib/puppet/scheduler/splay_job.rb 18 def ready?(time) 19 if last_run 20 super 21 else 22 start_time + splay <= time 23 end 24 end
Private Instance Methods
calculate_splay(limit)
click to toggle source
# File lib/puppet/scheduler/splay_job.rb 28 def calculate_splay(limit) 29 rand(limit + 1) 30 end