Module: ObjectPerformLater

Defined in:
lib/object_perform_later.rb

Instance Method Summary collapse

Instance Method Details

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



2
3
4
5
6
7
# File 'lib/object_perform_later.rb', line 2

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

  worker = PerformLater::Workers::Objects::Worker
  perform_later_enqueue(worker, queue, method, args)
end

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



9
10
11
12
13
14
15
16
# File 'lib/object_perform_later.rb', line 9

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

  return "EXISTS!" if loner_exists(method, args)

  worker = PerformLater::Workers::Objects::LoneWorker
  perform_later_enqueue(worker, queue, method, args)
end