lib/sucker_punch/backgroundable/job.rb in sucker_punch-backgroundable-0.2.0 vs lib/sucker_punch/backgroundable/job.rb in sucker_punch-backgroundable-0.3.0
- old
+ new
@@ -35,14 +35,10 @@
def perform(receiver, method, args, options)
receiver = load(receiver) if instantiate?(options)
call(receiver, method, *args)
end
-
- def later(sec, *args)
- after(sec) { perform(*args) }
- end
end
class JobRunner
include CallMethod
@@ -52,12 +48,12 @@
def run(seconds = 0)
if SuckerPunch::Backgroundable.configuration.enabled
# run as SuckerPunch Job
if seconds > 0
- Job.new.async.later(seconds, @receiver, @method, @args, @options)
+ Job.perform_in(seconds, @receiver, @method, @args, @options)
else
- Job.new.async.perform(@receiver, @method, @args, @options)
+ Job.perform_async(@receiver, @method, @args, @options)
end
else
# run without SuckerPunch or Celluloid
@receiver = load(@receiver) if instantiate?(@options)
call(@receiver, @method, *@args)
\ No newline at end of file