Mongrel::HttpServer.new 指定处理请求的线程数

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'rubygems'
require 'mongrel'

class BasicServer < Mongrel::HttpHandler
  def process(request, response)
    response.start(200) do |headers, output|
      headers["Content-Type"] = 'text/html'
      output.write('<html><body><h1>Hello!</h1></body></html>')
    end
  end
end

s = Mongrel::HttpServer.new("0.0.0.0", "1234",20) #启动20个线程
s.register("/", BasicServer.new)
s.run.join