class MultiWorker::Adapters::Qu

Public Class Methods

configure(base, opts={}) click to toggle source
# File lib/multi_worker/adapters/qu.rb, line 4
def self.configure(base, opts={})
  base.class_eval do
    @queue = opts[:queue]

    def self.perform(*args)
      self.new.perform(*args)
    end

    def self.perform_async(*args)
      ::Qu.enqueue(self, *args)
    end

    def perform_async(*args)
      self.class.perform_async(*args)
    end
  end
end
perform(*args) click to toggle source
# File lib/multi_worker/adapters/qu.rb, line 8
def self.perform(*args)
  self.new.perform(*args)
end
perform_async(*args) click to toggle source
# File lib/multi_worker/adapters/qu.rb, line 12
def self.perform_async(*args)
  ::Qu.enqueue(self, *args)
end
rake_task() click to toggle source
# File lib/multi_worker/adapters/qu.rb, line 22
def self.rake_task
  require 'rake'
  require 'qu/tasks'

  ::Rake::Task['qu:work']
end

Public Instance Methods

perform_async(*args) click to toggle source
# File lib/multi_worker/adapters/qu.rb, line 16
def perform_async(*args)
  self.class.perform_async(*args)
end