Sha256: 14a71f3d3ba12fc9af1a5bbbd6ef7ccd509291175c7d910899dd087e0ea754f7

Contents?: true

Size: 469 Bytes

Versions: 5

Compression:

Stored size: 469 Bytes

Contents

module Appsignal
  class Hooks
    class PumaHook < Appsignal::Hooks::Hook
      register :puma

      def dependencies_present?
        defined?(::Puma) &&
          ::Puma.respond_to?(:cli_config) &&
          ::Puma.cli_config
      end

      def install
        ::Puma.cli_config.options[:before_worker_shutdown] ||= []
        ::Puma.cli_config.options[:before_worker_shutdown] << Proc.new do |id|
          Appsignal.stop
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
appsignal-0.12.rc.12 lib/appsignal/hooks/puma.rb
appsignal-0.12.rc.11 lib/appsignal/hooks/puma.rb
appsignal-0.12.rc.10 lib/appsignal/hooks/puma.rb
appsignal-0.12.rc.9 lib/appsignal/hooks/puma.rb
appsignal-0.12.rc.8 lib/appsignal/hooks/puma.rb