Sha256: 14d1e944ae5b8c8b56c4fca25d7abd99e47a1fee839a63848a14dd9492cf5598

Contents?: true

Size: 789 Bytes

Versions: 53

Compression:

Stored size: 789 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
              shutdown_without_appsignal
            end
          end
        end
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
appsignal-1.0.2.beta.3 lib/appsignal/hooks/celluloid.rb
appsignal-1.0.2.beta.2 lib/appsignal/hooks/celluloid.rb
appsignal-1.0.2.beta.1 lib/appsignal/hooks/celluloid.rb
appsignal-1.0.1 lib/appsignal/hooks/celluloid.rb
appsignal-1.0.0 lib/appsignal/hooks/celluloid.rb
appsignal-1.0.0.rc.1 lib/appsignal/hooks/celluloid.rb
appsignal-0.12.rc.14 lib/appsignal/hooks/celluloid.rb
appsignal-0.12.rc.13 lib/appsignal/hooks/celluloid.rb
appsignal-0.12.rc.12 lib/appsignal/hooks/celluloid.rb
appsignal-0.12.rc.11 lib/appsignal/hooks/celluloid.rb
appsignal-0.12.rc.10 lib/appsignal/hooks/celluloid.rb
appsignal-0.12.rc.9 lib/appsignal/hooks/celluloid.rb
appsignal-0.12.rc.8 lib/appsignal/hooks/celluloid.rb