Sha256: f19ce2c8d6178d2d7591270c1c385332f35895da9680f23e5c587af84e911147

Contents?: true

Size: 529 Bytes

Versions: 206

Compression:

Stored size: 529 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  class Hooks
    # @api private
    class PumaHook < Appsignal::Hooks::Hook
      register :puma

      def dependencies_present?
        defined?(::Puma)
      end

      def install
        return unless defined?(::Puma::Cluster)

        # For clustered mode with multiple workers
        ::Puma::Cluster.send(:prepend, Module.new do
          def stop_workers
            Appsignal.stop("puma cluster")
            super
          end
        end)
      end
    end
  end
end

Version data entries

206 entries across 206 versions & 1 rubygems

Version Path
appsignal-4.0.4-java lib/appsignal/hooks/puma.rb
appsignal-4.0.4 lib/appsignal/hooks/puma.rb
appsignal-4.0.3-java lib/appsignal/hooks/puma.rb
appsignal-4.0.3 lib/appsignal/hooks/puma.rb
appsignal-4.0.2-java lib/appsignal/hooks/puma.rb
appsignal-4.0.2 lib/appsignal/hooks/puma.rb
appsignal-4.0.1-java lib/appsignal/hooks/puma.rb
appsignal-4.0.1 lib/appsignal/hooks/puma.rb
appsignal-4.0.0-java lib/appsignal/hooks/puma.rb
appsignal-4.0.0 lib/appsignal/hooks/puma.rb
appsignal-3.13.1-java lib/appsignal/hooks/puma.rb
appsignal-3.13.1 lib/appsignal/hooks/puma.rb
appsignal-3.13.1.alpha.1-java lib/appsignal/hooks/puma.rb
appsignal-3.13.1.alpha.1 lib/appsignal/hooks/puma.rb
appsignal-4.0.0.beta.2-java lib/appsignal/hooks/puma.rb
appsignal-4.0.0.beta.2 lib/appsignal/hooks/puma.rb
appsignal-4.0.0.beta.1-java lib/appsignal/hooks/puma.rb
appsignal-4.0.0.beta.1 lib/appsignal/hooks/puma.rb
appsignal-3.13.0-java lib/appsignal/hooks/puma.rb
appsignal-3.13.0 lib/appsignal/hooks/puma.rb