Class: Symphony::Metronome::ScheduleTask

Inherits:
Task
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeScheduleTask

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

#actionsObject (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_parentObject

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