Class: Symphony::Metronome::ScheduleTask
- Inherits:
-
Task
- Object
- Task
- Symphony::Metronome::ScheduleTask
- Includes:
- Routing
- Defined in:
- lib/symphony/tasks/scheduletask.rb
Overview
Accept metronome scheduling events, translating them to DB rows for persistence.
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
The Sequel dataset of scheduled event actions.
Instance Method Summary collapse
-
#initialize ⇒ ScheduleTask
constructor
Get a handle to the database.
-
#signal_parent ⇒ Object
Tell our parent (the Metronome broadcaster) to re-read its event list.
Constructor Details
#initialize ⇒ ScheduleTask
Get a handle to the database.
20 21 22 23 24 |
# File 'lib/symphony/tasks/scheduletask.rb', line 20 def initialize( * ) @db = Symphony::Metronome::ScheduledEvent.db @actions = @db[ :metronome ] super end |
Instance Attribute Details
#actions ⇒ Object (readonly)
The Sequel dataset of scheduled event actions.
27 28 29 |
# File 'lib/symphony/tasks/scheduletask.rb', line 27 def actions @actions end |
Instance Method Details
#signal_parent ⇒ Object
Tell our parent (the Metronome broadcaster) to re-read its event list.
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/symphony/tasks/scheduletask.rb', line 68 def signal_parent parent = Process.ppid # Check to make sure we weren't orphaned. # if parent == 1 self.log.error "Lost my parent process? Exiting." exit 1 end Process.kill( 'HUP', parent ) end |