lib/reactor/event.rb in reactor-0.2.5 vs lib/reactor/event.rb in reactor-0.2.6
- old
+ new
@@ -22,13 +22,19 @@
name
end
def self.publish(name, data = {})
message = new(data.merge(event: name))
- if (message.at)
- delay_until(message.at).process name, message.data
- else
+ #if (message.at)
+ # delay_until(message.at).process name, message.data
+ #else
+ # delay.process name, message.data
+ #end
+
+ if message.at.nil?
delay.process name, message.data
+ elsif message.at.future?
+ delay_until(message.at).process name, message.data
end
end
def self.reschedule(name, data = {})
job = scheduled_jobs.detect do |job|