diff options
Diffstat (limited to 'activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb')
-rw-r--r-- | activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb b/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb new file mode 100644 index 0000000000..d74f8cf90e --- /dev/null +++ b/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb @@ -0,0 +1,25 @@ +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) + end + + def enqueue_at(job, timestamp, *args) + raise NotImplementedError + end + end + + class JobWrapper + class << self + def perform(job_name, *args) + job_name.constantize.new.execute(*args) + end + end + end + end + end +end |