class RorVsWild::Plugin::Faktory

Public Class Methods

setup() click to toggle source
# File lib/rorvswild/plugin/faktory.rb, line 4
def self.setup
  if defined?(::Faktory)
    ::Faktory.configure_worker do |config|
      config.worker_middleware { |chain| chain.add(Faktory) }
    end
  end
end

Public Instance Methods

call(worker_instance, job, &block) click to toggle source
# File lib/rorvswild/plugin/faktory.rb, line 12
def call(worker_instance, job, &block)
  custom = job["custom".freeze]
  name = (custom && custom["wrapped".freeze]) || job["jobtype".freeze]
  RorVsWild.agent.measure_job(name, parameters: job["args".freeze], &block)
end