Sha256: 3bddda5239bc0a24c2289fe867aca8e153eea1ddf5cc8bd7bb666cbb0cd938a9

Contents?: true

Size: 786 Bytes

Versions: 28

Compression:

Stored size: 786 Bytes

Contents

if defined?(::Resque)
  Appsignal.logger.info('Loading Resque integration')

  module Appsignal
    module Integrations
      module ResquePlugin
        def around_perform_resque_plugin(*args)
          Appsignal.monitor_transaction(
            'perform_job.resque',
            :class => self.to_s,
            :method => 'perform'
          ) do
            yield
          end
        end
      end
    end
  end

  # Set up IPC
  Resque.before_first_fork do
    Appsignal::IPC::Server.start
  end

  # In the fork, stop the normal agent startup
  # and stop listening to the server
  Resque.after_fork do |job|
    Appsignal::IPC.forked!
  end

  # Extend the default job class with AppSignal instrumentation
  Resque::Job.send(:extend, Appsignal::Integrations::ResquePlugin)
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
appsignal-0.11.13.beta.3 lib/appsignal/integrations/resque.rb
appsignal-0.11.13.beta.2 lib/appsignal/integrations/resque.rb
appsignal-0.11.13.beta.1 lib/appsignal/integrations/resque.rb
appsignal-0.11.13.beta.0 lib/appsignal/integrations/resque.rb
appsignal-0.11.12 lib/appsignal/integrations/resque.rb
appsignal-0.11.11 lib/appsignal/integrations/resque.rb
appsignal-0.11.10 lib/appsignal/integrations/resque.rb
appsignal-0.11.10.beta.2 lib/appsignal/integrations/resque.rb
appsignal-0.11.10.beta.1 lib/appsignal/integrations/resque.rb
appsignal-0.11.9 lib/appsignal/integrations/resque.rb
appsignal-0.11.8.beta.4 lib/appsignal/integrations/resque.rb
appsignal-0.11.8.beta.3 lib/appsignal/integrations/resque.rb
appsignal-0.11.8.beta.2 lib/appsignal/integrations/resque.rb
appsignal-0.11.8.beta.1 lib/appsignal/integrations/resque.rb
appsignal-0.11.8.beta.0 lib/appsignal/integrations/resque.rb
appsignal-0.11.7 lib/appsignal/integrations/resque.rb
appsignal-0.11.7.beta.1 lib/appsignal/integrations/resque.rb
appsignal-0.11.6 lib/appsignal/integrations/resque.rb
appsignal-0.11.6.beta.0 lib/appsignal/integrations/resque.rb
appsignal-0.11.5 lib/appsignal/integrations/resque.rb