Sha256: e2da9adad734185b2705c472b4d866d5c68876d3ddacec450e8d683c68b565e3

Contents?: true

Size: 858 Bytes

Versions: 39

Compression:

Stored size: 858 Bytes

Contents

# typed: ignore

# Copyright (c) 2015 Sqreen. All Rights Reserved.
# Please refer to our terms for more information: https://www.sqreen.com/terms.html

module Sqreen
  module WebServer
    module Passenger
      def self.active?
        Sqreen::Dependency.const_exist?('PhusionPassenger::App')
      end

      def forking?
        ::PhusionPassenger::App.options['spawn_method'] == 'smart' # otherwise direct
      end

      def preload_app?
        forking? # overarching spawn method behavior
      end

      def master?
        preload_app? # overarching spawn method behavior
      end

      def before_fork(&block); end

      def after_fork
        after_fork = lambda do |forked|
          yield if forked # forked == true in child
        end
        ::PhusionPassenger.on_event(:starting_worker_process, &after_fork)
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
sqreen-1.25.1 lib/sqreen/web_server/passenger.rb
sqreen-1.25.0 lib/sqreen/web_server/passenger.rb
sqreen-1.24.3 lib/sqreen/web_server/passenger.rb
sqreen-1.24.2 lib/sqreen/web_server/passenger.rb
sqreen-1.24.1 lib/sqreen/web_server/passenger.rb
sqreen-1.24.0 lib/sqreen/web_server/passenger.rb
sqreen-1.23.2 lib/sqreen/web_server/passenger.rb
sqreen-1.23.1 lib/sqreen/web_server/passenger.rb
sqreen-1.23.0 lib/sqreen/web_server/passenger.rb
sqreen-1.22.1 lib/sqreen/web_server/passenger.rb
sqreen-1.22.0-java lib/sqreen/web_server/passenger.rb
sqreen-1.22.0 lib/sqreen/web_server/passenger.rb
sqreen-1.21.1-java lib/sqreen/web_server/passenger.rb
sqreen-1.21.1 lib/sqreen/web_server/passenger.rb
sqreen-1.21.0-java lib/sqreen/web_server/passenger.rb
sqreen-1.21.0 lib/sqreen/web_server/passenger.rb
sqreen-1.20.4-java lib/sqreen/web_server/passenger.rb
sqreen-1.20.4 lib/sqreen/web_server/passenger.rb
sqreen-1.21.0.beta3-java lib/sqreen/web_server/passenger.rb
sqreen-1.21.0.beta3 lib/sqreen/web_server/passenger.rb