Sha256: f749aca2f9377ecad7ac969d8cb0e5b1791b21debf82b08642f5910ff623197d

Contents?: true

Size: 821 Bytes

Versions: 38

Compression:

Stored size: 821 Bytes

Contents

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

38 entries across 38 versions & 1 rubygems

Version Path
appsignal-2.5.3-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.3 lib/appsignal/hooks/celluloid.rb
appsignal-2.5.3.alpha.2 lib/appsignal/hooks/celluloid.rb
appsignal-2.5.3.alpha.2-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.3.alpha.1 lib/appsignal/hooks/celluloid.rb
appsignal-2.5.3.alpha.1-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.2-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.2 lib/appsignal/hooks/celluloid.rb
appsignal-2.5.1-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.1 lib/appsignal/hooks/celluloid.rb
appsignal-2.5.1.beta.1-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.1.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-2.5.0-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.0 lib/appsignal/hooks/celluloid.rb
appsignal-2.5.0.beta.1-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.0.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-2.5.0.alpha.1-java lib/appsignal/hooks/celluloid.rb
appsignal-2.5.0.alpha.1 lib/appsignal/hooks/celluloid.rb
appsignal-2.4.3 lib/appsignal/hooks/celluloid.rb
appsignal-2.4.2 lib/appsignal/hooks/celluloid.rb