Sha256: f467d91bfd50335b64f55ce26c62abd251123a1069d86741e4f2b214e8782500

Contents?: true

Size: 802 Bytes

Versions: 63

Compression:

Stored size: 802 Bytes

Contents

module Appsignal
  class Hooks
    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

63 entries across 63 versions & 1 rubygems

Version Path
appsignal-1.2.1.beta.2 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.1.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.0 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.0.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.0.alpha.6 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.0.alpha.5 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.0.alpha.4 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.9 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.9.beta.2 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.9.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.8 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.0.alpha.3 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.7 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.0.alpha.2 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.7.beta.2 lib/appsignal/hooks/celluloid.rb
appsignal-1.2.0.alpha.1 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.7.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.6 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.6.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-1.1.5 lib/appsignal/hooks/celluloid.rb