Sha256: 7e51cf368101b1fa81b008d994c5b1a7f73af4e47c4e073ec9a520db5cca4e60

Contents?: true

Size: 568 Bytes

Versions: 33

Compression:

Stored size: 568 Bytes

Contents

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

  # We'd love to be able to hook this into Unicorn in a less
  # intrusive way, but this is the best we can do given the
  # options we have.

  class Unicorn::HttpServer
    alias_method :original_worker_loop, :worker_loop

    def worker_loop(worker)
      Appsignal.agent.forked!
      original_worker_loop(worker)
    end
  end

  class Unicorn::Worker
    alias_method :original_close, :close

    def close
      Appsignal.agent.shutdown(true)
      original_close
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
appsignal-0.9.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.9.0 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.15 lib/appsignal/integrations/unicorn.rb
appsignal-0.9.0.beta.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.9.0.alpha.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.14 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.13 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.12 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.11 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.10 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.8 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.7 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.7.alpha.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.6 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.6.beta.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.6.beta.0 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.5 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.4 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.4.beta.1 lib/appsignal/integrations/unicorn.rb
appsignal-0.8.4.beta.0 lib/appsignal/integrations/unicorn.rb