Sha256: 770b264c6bc5f2245072bb3a1943627390011201d204485d8260058a360aed33

Contents?: true

Size: 760 Bytes

Versions: 246

Compression:

Stored size: 760 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.singleton_class.send(:prepend, Module.new do
          def shutdown
            Appsignal.stop("celluloid")
            super
          end
        end)
      end
    end
  end
end

Version data entries

246 entries across 246 versions & 1 rubygems

Version Path
appsignal-3.0.19-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.19 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.18-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.18 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.17-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.17 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.16-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.16 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.15-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.15 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.14-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.14 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.13-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.13 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.12-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.12 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.11-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.11 lib/appsignal/hooks/celluloid.rb
appsignal-3.0.10-java lib/appsignal/hooks/celluloid.rb
appsignal-3.0.10 lib/appsignal/hooks/celluloid.rb