Class: Puppet::Scheduler::SplayJob Private
- Defined in:
- lib/puppet/scheduler/splay_job.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #splay ⇒ Object readonly private
Attributes inherited from Job
#last_run, #run_interval, #start_time
Instance Method Summary collapse
-
#initialize(run_interval, splay_limit, &block) ⇒ SplayJob
constructor
private
A new instance of SplayJob.
- #interval_to_next_from(time) ⇒ Object private
- #ready?(time) ⇒ Boolean private
Methods inherited from Job
#disable, #enable, #enabled?, #run
Constructor Details
#initialize(run_interval, splay_limit, &block) ⇒ SplayJob
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SplayJob.
5 6 7 8 |
# File 'lib/puppet/scheduler/splay_job.rb', line 5 def initialize(run_interval, splay_limit, &block) @splay = calculate_splay(splay_limit) super(run_interval, &block) end |
Instance Attribute Details
#splay ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
3 4 5 |
# File 'lib/puppet/scheduler/splay_job.rb', line 3 def splay @splay end |
Instance Method Details
#interval_to_next_from(time) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 |
# File 'lib/puppet/scheduler/splay_job.rb', line 10 def interval_to_next_from(time) if last_run super else (start_time + splay) - time end end |
#ready?(time) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 23 24 |
# File 'lib/puppet/scheduler/splay_job.rb', line 18 def ready?(time) if last_run super else start_time + splay <= time end end |