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

26 lines
550 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 enqueue(job, *args)
QC::Queue.new(job.queue_name).enqueue("#{JobWrapper.name}.perform", job.name, *args)
2014-05-19 17:01:56 -04:00
end
def enqueue_at(job, timestamp, *args)
raise NotImplementedError
end
2014-05-19 17:01:56 -04:00
end
class JobWrapper
class << self
def perform(job_name, *args)
job_name.constantize.new.execute(*args)
end
2014-05-19 17:01:56 -04:00
end
end
end
end
end