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/sucker_punch_adapter.rb

26 lines
470 B
Ruby
Raw Normal View History

2014-05-18 15:20:06 -04:00
require 'sucker_punch'
module ActiveJob
module QueueAdapters
class SuckerPunchAdapter
class << self
2014-08-25 10:34:50 -04:00
def enqueue(job)
JobWrapper.new.async.perform job.serialize
2014-05-19 06:34:27 -04:00
end
2014-08-25 10:34:50 -04:00
def enqueue_at(job, timestamp)
2014-05-20 12:52:20 -04:00
raise NotImplementedError
end
2014-05-19 06:34:27 -04:00
end
class JobWrapper #:nodoc:
2014-05-19 06:34:27 -04:00
include SuckerPunch::Job
2014-08-25 10:34:50 -04:00
def perform(job_data)
Base.execute job_data
2014-05-18 15:20:06 -04:00
end
end
end
end
end