Sha256: f9a719776a0fde07cc51b9392dd5c2e0d3dd01528dbb3ee9d996582d639ce61a

Contents?: true

Size: 800 Bytes

Versions: 1

Compression:

Stored size: 800 Bytes

Contents

module Vizsla
  module BackgroundJobInstrumentation
    def self.install(inst_name)
      self.send inst_name
    end

    private

    def self.sidekiq
      require 'vizsla/background_job_instrumentation/sidekiq'

      ::Sidekiq.configure_server do |config|
        config.server_middleware do |chain|
          chain.add ::Vizsla::BackgroundJobInstrumentation::Sidekiq
        end
      end
    end

    def self.resque
      require 'vizsla/background_job_instrumentation/resque'

      ::Resque::Job.class_eval do
        def self.new(*args)
          super(*args).extend ::Vizsla::BackgroundJobInstrumentation::
            ResqueInstrumentationInstaller
        end
      end
    end

    def self.active_job
      require 'vizsla/background_job_instrumentation/active_job'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tracebin-0.0.7 lib/vizsla/background_job_instrumentation.rb