Sha256: 508af0b77123a10b8a5f2ebc2f3b8b8620046138974e59a325e2db83526c959c

Contents?: true

Size: 852 Bytes

Versions: 160

Compression:

Stored size: 852 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  class Hooks
    # @api private
    class CelluloidHook < Appsignal::Hooks::Hook
      register :celluloid

      def dependencies_present?
        defined?(::Celluloid)
      end

      def install
        # Some versions of Celluloid have race conditions while exiting
        # that can result in a dead lock. We stop appsignal before shutting
        # down Celluloid so we're sure our thread does not aggravate this situation.
        # This way we also make sure any outstanding transactions get flushed.

        ::Celluloid.class_eval do
          class << self
            alias shutdown_without_appsignal shutdown

            def shutdown
              Appsignal.stop("celluloid")
              shutdown_without_appsignal
            end
          end
        end
      end
    end
  end
end

Version data entries

160 entries across 160 versions & 1 rubygems

Version Path
appsignal-2.11.0.alpha.2 lib/appsignal/hooks/celluloid.rb
appsignal-2.11.0.alpha.2-java lib/appsignal/hooks/celluloid.rb
appsignal-2.11.0.alpha.1 lib/appsignal/hooks/celluloid.rb
appsignal-2.11.0.alpha.1-java lib/appsignal/hooks/celluloid.rb
appsignal-2.10.9 lib/appsignal/hooks/celluloid.rb
appsignal-2.10.9-java lib/appsignal/hooks/celluloid.rb
appsignal-2.10.9.beta.1-java lib/appsignal/hooks/celluloid.rb
appsignal-2.10.9.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-2.10.8 lib/appsignal/hooks/celluloid.rb
appsignal-2.10.8-java lib/appsignal/hooks/celluloid.rb
appsignal-2.10.7-java lib/appsignal/hooks/celluloid.rb
appsignal-2.10.7 lib/appsignal/hooks/celluloid.rb
appsignal-2.10.6-java lib/appsignal/hooks/celluloid.rb
appsignal-2.10.6 lib/appsignal/hooks/celluloid.rb
appsignal-2.10.6.beta.1-java lib/appsignal/hooks/celluloid.rb
appsignal-2.10.6.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-2.10.5-java lib/appsignal/hooks/celluloid.rb
appsignal-2.10.5 lib/appsignal/hooks/celluloid.rb
appsignal-2.10.4 lib/appsignal/hooks/celluloid.rb
appsignal-2.10.4-java lib/appsignal/hooks/celluloid.rb