2014-05-19 17:01:56 -04:00
|
|
|
require 'queue_classic'
|
|
|
|
|
|
|
|
module ActiveJob
|
|
|
|
module QueueAdapters
|
|
|
|
class QueueClassicAdapter
|
|
|
|
class << self
|
|
|
|
def queue(job, *args)
|
2014-05-20 05:37:04 -04:00
|
|
|
QC::Queue.new(job.queue_name).enqueue("#{JobWrapper.name}.perform", job, *args)
|
2014-05-19 17:01:56 -04:00
|
|
|
end
|
2014-05-19 18:27:28 -04:00
|
|
|
|
|
|
|
def queue_at(job, timestamp, *args)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2014-05-19 17:01:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
class JobWrapper
|
|
|
|
def self.perform(job, *args)
|
2014-05-20 18:26:19 -04:00
|
|
|
job.new.perform_with_deserialization *args
|
2014-05-19 17:01:56 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|