Sha256: aab9fae77ca6591f8afefddd7138f856a744a3231190ab51bc6bcc2e0598be2d

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/resque/configuration/settings'
require 'ddtrace/contrib/resque/patcher'

module Datadog
  module Contrib
    module Resque
      # Description of Resque integration
      class Integration
        include Contrib::Integration

        MINIMUM_VERSION = Gem::Version.new('1.0')
        # Maximum is first version it's NOT compatible with (not inclusive)
        MAXIMUM_VERSION = Gem::Version.new('3.0')

        register_as :resque, auto_patch: true

        def self.version
          Gem.loaded_specs['resque'] && Gem.loaded_specs['resque'].version
        end

        def self.loaded?
          !defined?(::Resque).nil?
        end

        def self.compatible?
          super \
            && version >= Gem::Version.new('1.0') \
            && version < MAXIMUM_VERSION
        end

        def default_configuration
          Configuration::Settings.new
        end

        def patcher
          Patcher
        end

        class << self
          # Globally-acccesible reference for pre-forking optimization
          attr_accessor :sync_writer
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.46.0 lib/ddtrace/contrib/resque/integration.rb
ddtrace-0.45.0 lib/ddtrace/contrib/resque/integration.rb
ddtrace-0.44.0 lib/ddtrace/contrib/resque/integration.rb
ddtrace-0.43.0 lib/ddtrace/contrib/resque/integration.rb
ddtrace-0.42.0 lib/ddtrace/contrib/resque/integration.rb