1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/lib/active_job/queue_adapters/queue_classic_adapter.rb

24 lines
504 B
Ruby
Raw Normal View History

2014-05-19 17:01:56 -04:00
require 'queue_classic'
module ActiveJob
module QueueAdapters
class QueueClassicAdapter
class << self
def queue(job, *args)
QC::Queue.new(job.queue_name).enqueue("#{JobWrapper.name}.perform", job, *args)
2014-05-19 17:01:56 -04:00
end
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)
job.new.perform_with_deserialization *args
2014-05-19 17:01:56 -04:00
end
end
end
end
end