Class: Cronic::Scheduler
- Inherits:
-
Object
- Object
- Cronic::Scheduler
- Defined in:
- lib/cronic/scheduler.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Scheduler
constructor
A new instance of Scheduler.
-
#join ⇒ Object
blocks until the scheduler exits for some reason.
- #load_jobs(file) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Scheduler
Returns a new instance of Scheduler.
12 13 14 15 |
# File 'lib/cronic/scheduler.rb', line 12 def initialize(opts = {}) @rufus_scheduler = Rufus::Scheduler.start_new(opts) setup_exception_handler end |
Instance Method Details
#join ⇒ Object
blocks until the scheduler exits for some reason
22 23 24 |
# File 'lib/cronic/scheduler.rb', line 22 def join @rufus_scheduler.join end |
#load_jobs(file) ⇒ Object
17 18 19 |
# File 'lib/cronic/scheduler.rb', line 17 def load_jobs(file) @rufus_scheduler.instance_eval IO.read file end |