blob: 341ea6158bdbc96f2c946e5bb829410ad378590b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
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 }
cattr_accessor(:queue_base_name) { "active_jobs" }
cattr_accessor(:queue_name) { queue_base_name }
class << self
def enqueue(*args)
queue_adapter.queue self, *args
end
def queue_as(part_name)
self.queue_name = "#{queue_base_name}_#{part_name}"
end
end
end
end
|