lib/reactor/event.rb in reactor-0.2.10 vs lib/reactor/event.rb in reactor-0.3.0
- old
+ new
@@ -53,9 +53,15 @@
#TODO: support more matching?
Reactor::Subscriber.where(event: '*').each do |s|
Reactor::Subscriber.delay.fire s.id, data
end
+
+ if (static_subscribers = Reactor::STATIC_SUBSCRIBERS[name.to_s] || []).any?
+ static_subscribers.each do |callback|
+ callback.call(Reactor::Event.new(data.merge(event: name.to_s)))
+ end
+ end
end
private
def self.scheduled_jobs(options = {})