6 attr_accessor :triggers # {task.name => condition}
13 def self.register(condition)
15 self.triggers[condition.watch.name] ||= []
16 self.triggers[condition.watch.name] << condition
20 def self.deregister(condition)
22 self.triggers[condition.watch.name].delete(condition)
23 self.triggers.delete(condition.watch.name) if self.triggers[condition.watch.name].empty?
27 def self.broadcast(task, message, payload)
28 return unless self.triggers[task.name]
31 self.triggers[task.name].each do |t|
32 t.process(message, payload)