static public Method

Spawner.spawn_all

There's no documentation for this item.

Source Code

# File commands/process/spawner.rb, line 23
def self.spawn_all
  OPTIONS[:instances].times do |i|
    port = OPTIONS[:port] + i
    print "Checking if something is already running on #{OPTIONS[:address]}:#{port}..."

    begin
      srv = TCPServer.new(OPTIONS[:address], port)
      srv.close
      srv = nil

      puts "NO"
      puts "Starting dispatcher on port: #{OPTIONS[:address]}:#{port}"

      FileUtils.mkdir_p(OPTIONS[:pids])
      spawn(port)
    rescue
      puts "YES"
    end
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.