Module: Resque::Plugins::Later::Method

Extended by:
ActiveSupport::Concern
Defined in:
lib/resque/plugins/later/method.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#perform_later(queue, method, *args) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/resque/plugins/later/method.rb', line 27

def perform_later(queue, method, *args)
  return self.send(method, *args) unless PerformLater.config.enabled?
  

  worker = PerformLater::Workers::ActiveRecord::Worker
  enqueue_in_resque_or_send(worker, queue, method, args)
end

#perform_later!(queue, method, *args) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/resque/plugins/later/method.rb', line 35

def perform_later!(queue, method, *args)
  return self.send(method, *args) unless PerformLater.config.enabled?
  return "AR EXISTS!" if loner_exists(method, args)
  
  worker = PerformLater::Workers::ActiveRecord::LoneWorker
  enqueue_in_resque_or_send(worker, queue, method, args)
end