Class: Unicron::Schedule
- Inherits:
-
Object
- Object
- Unicron::Schedule
- Defined in:
- lib/unicron/schedule.rb
Overview
Schedule manages a JobQueue which contains Job instances, and a thread which pops and executes them. For simplicity’s sake, the Unicron module manages a default Schedule, but you can create and manage your own if necessary. Each uses its own JobQueue and thread, so they will not interfere with each other.
Instance Method Summary collapse
-
#<<(job) ⇒ Object
Add a Job to the Schedule’s JobQueue.
-
#initialize ⇒ Schedule
constructor
Create a new, empty Schedule.
-
#schedule(options = {}, &block) ⇒ Object
Create a new Job and add it to the Schedule.
Constructor Details
Instance Method Details
#<<(job) ⇒ Object
Add a Job to the Schedule’s JobQueue.
12 13 14 15 |
# File 'lib/unicron/schedule.rb', line 12 def << job @queue << job self end |