Sha256: a4a9b82fc44e8b7ac6c3a162bdac67ce0b3bdd7361c99088c73bcabcb07b607f
Contents?: true
Size: 789 Bytes
Versions: 1
Compression:
Stored size: 789 Bytes
Contents
module MultiWorker module Adapters class Sneakers def self.configure(base, opts={}) require 'json' base.class_eval do include ::Sneakers::Worker from_queue opts[:queue], opts.fetch(:adapter_opts, {}) def work(msg) args = JSON.parse(msg) perform(*args) end def self.perform(*args) self.new.perform(*args) end def self.perform_async(*args) ::Sneakers.publish(args.to_json, to_queue: @queue) end def perform_async(*args) self.class.perform_async(*args) #@queue.exchange.publish(args.to_json, :to_queue => @queue) end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
multi_worker-0.2.0 | lib/multi_worker/adapters/sneakers.rb |