Rufus::Scheduler::CronJobQueue

Tracking cron jobs.

Public Class Methods

new() click to toggle source
     # File lib/rufus/sc/jobqueues.rb, line 129
129:     def initialize
130: 
131:       super
132:       @last_cron_second = nil
133:     end

Public Instance Methods

<<(job) click to toggle source
     # File lib/rufus/sc/jobqueues.rb, line 149
149:     def <<(job)
150: 
151:       @mutex.synchronize do
152:         delete(job.job_id)
153:         @jobs << job
154:       end
155:     end
trigger_matching_jobs() click to toggle source
     # File lib/rufus/sc/jobqueues.rb, line 135
135:     def trigger_matching_jobs
136: 
137:       now = Time.now
138: 
139:       return if now.sec == @last_cron_second
140:       @last_cron_second = now.sec
141:         #
142:         # ensuring the crons are checked within 1 second (not 1.2 second)
143: 
144:       jobs = @mutex.synchronize { @jobs.dup }
145: 
146:       jobs.each { |job| job.trigger_if_matches(now) }
147:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.