Module: Datadog::Contrib::Resque::Patcher

Includes:
Patcher
Defined in:
lib/ddtrace/contrib/resque/patcher.rb

Overview

Patcher enables patching of ‘resque’ module.

Class Method Summary collapse

Methods included from Patcher

included

Class Method Details

.get_option(option) ⇒ Object



29
30
31
# File 'lib/ddtrace/contrib/resque/patcher.rb', line 29

def get_option(option)
  Datadog.configuration[:resque].get_option(option)
end

.patchObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/ddtrace/contrib/resque/patcher.rb', line 18

def patch
  do_once(:resque) do
    begin
      require_relative 'resque_job'
      get_option(:workers).each { |worker| worker.extend(ResqueJob) }
    rescue StandardError => e
      Datadog::Tracer.log.error("Unable to apply Resque integration: #{e}")
    end
  end
end

.patched?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/ddtrace/contrib/resque/patcher.rb', line 14

def patched?
  done?(:resque)
end