class Object

Public Instance Methods

fork() { || ... } click to toggle source
# File lib/app_dynamics.rb, line 13
    def fork
      if (instrumenter = AppDynamics.instrumenter)
        if instrumenter.fully_started?
          AppDynamics.log_error <<~MESSAGE

            Can't fork after agent has fully started. See documentation for more details.

          MESSAGE
          return false
        else
          AppDynamics.log_debug("Detected forking. Can safely continue since SDK has not yet initialized.")
        end
      end

      AppDynamics.before_fork

      if block_given?
        fork_without_appd do
          AppDynamics.after_fork
          yield
        end
      else
        ret = fork_without_appd
        if ret.nil?
          # We're in the child
          AppDynamics.after_fork
        end
        ret
      end
    end
Also aliased as: fork_without_appd
fork_without_appd()
Alias for: fork