aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_job/queue_adapters/delayed_job_adapter.rb
blob: 14072e2801caefb27ed473f5b6d847ba71c95125 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'delayed_job'

module ActiveJob
  module QueueAdapters
    class DelayedJobAdapter
      class << self
        def queue(job, *args)
          JobWrapper.new.delay(queue: job.queue_name).perform(job, *args)
        end
      end
      
      class JobWrapper
        def perform(job, *args)
          job.new.perform *Parameters.deserialize(args)
        end
      end
    end
  end
end