diff options
Diffstat (limited to 'lib/active_job/queue_adapters')
-rw-r--r-- | lib/active_job/queue_adapters/sneakers_adapter.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/active_job/queue_adapters/sneakers_adapter.rb b/lib/active_job/queue_adapters/sneakers_adapter.rb new file mode 100644 index 0000000000..be400dc477 --- /dev/null +++ b/lib/active_job/queue_adapters/sneakers_adapter.rb @@ -0,0 +1,24 @@ +require 'sneakers' + +module ActiveJob + module QueueAdapters + class SneakersAdapter + class << self + def queue(job, *args) + JobWrapper.enqueue([job, *args]) + end + end + + class JobWrapper + include Sneakers::Worker + + self.from_queue("queue", {}) + + def work(*args) + job_name = args.shift + job_name.new.perform *Parameters.deserialize(args) + end + end + end + end +end |