Sha256: 4953f42e766d166ecaf77dfc1f3467c6a36a30591e9fd362c0b3670ab5bf79aa

Contents?: true

Size: 812 Bytes

Versions: 6

Compression:

Stored size: 812 Bytes

Contents

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

    private

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

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

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

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tracebin-0.0.13 lib/tracebin/background_job_instrumentation.rb
tracebin-0.0.12 lib/tracebin/background_job_instrumentation.rb
tracebin-0.0.11 lib/tracebin/background_job_instrumentation.rb
tracebin-0.0.10 lib/tracebin/background_job_instrumentation.rb
tracebin-0.0.9 lib/tracebin/background_job_instrumentation.rb
tracebin-0.0.8 lib/tracebin/background_job_instrumentation.rb