The array rufus-scheduler uses to keep jobs in order (next to trigger first).
# File lib/rufus/scheduler/job_array.rb, line 77 def [](job_id) @mutex.synchronize { @array.find { |j| j.job_id == job_id } } end
Only used when shutting down, directly yields the underlying array.
# File lib/rufus/scheduler/job_array.rb, line 84 def array @array end
# File lib/rufus/scheduler/job_array.rb, line 64 def delete_unscheduled @mutex.synchronize { @array.delete_if { |j| j.next_time.nil? || j.unscheduled_at } } end
# File lib/rufus/scheduler/job_array.rb, line 53 def each(now, &block) to_a.sort_by { |j| j.next_time || (now + 1) }.each do |job| break unless job.next_time break if job.next_time > now block.call(job) end end
# File lib/rufus/scheduler/job_array.rb, line 41 def push(job) @mutex.synchronize { @array << job unless @array.index(job) } self end
Generated with the Darkfish Rdoc Generator 2.