diff options
Diffstat (limited to 'lib/active_job')
-rw-r--r-- | lib/active_job/base.rb | 7 | ||||
-rw-r--r-- | lib/active_job/queue_adapters/resque_adapter.rb (renamed from lib/active_job/queue_adapters/inline_queue.rb) | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/active_job/base.rb b/lib/active_job/base.rb index a404355026..e18c9d4309 100644 --- a/lib/active_job/base.rb +++ b/lib/active_job/base.rb @@ -1,10 +1,13 @@ -require 'active_job/queue_adapters/inline_queue' +require 'active_job/queue_adapters/inline_adapter' +require 'active_job/queue_adapters/resque_adapter' module ActiveJob class Base + cattr_accessor(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter } + class << self def enqueue(*args) - ActiveJob::QueueAdapters::InlineQueue.queue self, *args + queue_adapter.queue self, *args end end end diff --git a/lib/active_job/queue_adapters/inline_queue.rb b/lib/active_job/queue_adapters/resque_adapter.rb index dd80c6a5a3..4155cd5bf9 100644 --- a/lib/active_job/queue_adapters/inline_queue.rb +++ b/lib/active_job/queue_adapters/resque_adapter.rb @@ -1,9 +1,11 @@ +require 'resque' + module ActiveJob module QueueAdapters - class InlineQueue + class ResqueAdapter class << self def queue(job, *args) - job.perform *args + Resque.enqueue(job, *args) end end end |