Method: ZK::Server::SubProcess#run

Defined in:
lib/zk-server/sub_process.rb

#runfalse, true

start the child, using the Base#config. we create the files necessary, fork the child, and wait 5s for the child to start responding to pings

Returns:

  • (false, true)

    false if run has already been called on this instance true if we hav



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/zk-server/sub_process.rb', line 99

def run
  return false if @run_called
  @run_called = true

  create_files!

  if ZK::Server.mri_187?
    fork_and_exec!
  elsif ZK::Server.jruby? and not ZK::Server.ruby_19?
    raise "You must run Jruby in 1.9 compatibility mode! I'm very sorry, i need Kernel.spawn"
  else
    spawn!
  end

  spawn_exit_watching_thread

  unless wait_until_ping(@child_startup_timeout)
    raise "Oh noes! something went wrong!" unless running?
  end

  at_exit { self.shutdown }

  true
end