lib/eventsimple/event_dispatcher.rb in eventsimple-1.0.0 vs lib/eventsimple/event_dispatcher.rb in eventsimple-1.1.0

- old
+ new

@@ -27,14 +27,14 @@ # Dispatches events to matching Reactors once. # Called by all events after they are created. def self.dispatch(event) reactors = rules.for(event) reactors.sync.each do |reactor| - reactor.new(event).call + reactor.perform_now(event) event.reload end reactors.async.each do |reactor| - ReactorWorker.perform_async(event.to_global_id.to_s, reactor.to_s) + reactor.perform_later(event) end end def self.rules @rules ||= RuleSet.new