aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_job/queue_adapters/que_adapter.rb
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2014-05-19 18:09:45 +0000
committerAbdelkader Boudih <terminale@gmail.com>2014-05-20 09:57:31 +0000
commit6d009504a02fecb822820e18abd69dd569f72e82 (patch)
treeba9c5181194a0ae06e2e7c72f1a211ded9372506 /lib/active_job/queue_adapters/que_adapter.rb
parentf5c85dc021fd5c66d7f7a40f7de1b3877c88f62a (diff)
downloadrails-6d009504a02fecb822820e18abd69dd569f72e82.tar.gz
rails-6d009504a02fecb822820e18abd69dd569f72e82.tar.bz2
rails-6d009504a02fecb822820e18abd69dd569f72e82.zip
Add Que Adapter/Wrapper
Diffstat (limited to 'lib/active_job/queue_adapters/que_adapter.rb')
-rw-r--r--lib/active_job/queue_adapters/que_adapter.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/active_job/queue_adapters/que_adapter.rb b/lib/active_job/queue_adapters/que_adapter.rb
new file mode 100644
index 0000000000..6750882b91
--- /dev/null
+++ b/lib/active_job/queue_adapters/que_adapter.rb
@@ -0,0 +1,19 @@
+require 'que'
+
+module ActiveJob
+ module QueueAdapters
+ class QueAdapter
+ class << self
+ def queue(job, *args)
+ JobWrapper.enqueue job, *args, queue: job.queue_name
+ end
+ end
+
+ class JobWrapper < Que::Job
+ def run(job, *args)
+ job.new.perform *Parameters.deserialize(args)
+ end
+ end
+ end
+ end
+end