Class: Rufus::Scheduler::SignalScheduler

Inherits:
SchedulerCore show all
Defined in:
lib/rufus/sc/scheduler.rb

Overview

A rufus-scheduler that steps only when the ruby process receives the 10 / USR1 signal.

Instance Attribute Summary

Attributes inherited from SchedulerCore

#options

Instance Method Summary collapse

Methods inherited from SchedulerCore

#all_jobs, #at, #cron, #cron_jobs, #every, #find_by_tag, #handle_exception, #in, #jobs, start_new, #trigger_threads, #unschedule

Methods included from LegacyMethods

#at_job_count, #cron_job_count, #every_job_count, #find_jobs, #pending_job_count, #precision

Constructor Details

#initialize(opts = {}) ⇒ SignalScheduler

Returns a new instance of SignalScheduler.



389
390
391
392
393
394
395
396
# File 'lib/rufus/sc/scheduler.rb', line 389

def initialize (opts={})

  super(opts)

  trap(@options[:signal] || 10) do
    step
  end
end

Instance Method Details

#stopObject



398
399
400
401
# File 'lib/rufus/sc/scheduler.rb', line 398

def stop

  trap(@options[:signal] || 10)
end