| Class | WEBrick::HighPerformanceServer |
| In: |
lib/webrick/highperformanceserver.rb
|
| Parent: | WEBrick::HTTPServer |
A high performance WEBrick server that takes advantage of sendfile(2) and fork(2) to drastically increase the performance of serving static files.
Instead of starting a HighPerformanceServer like a regular HTTPServer, use HighPerformanceServer::create.
| listeners | [RW] | Server sockets for my children. |
Creates :Processes new HighPerformanceServers all listening on the same server sockets.
config and default work the same as they do for HTTPServer.
yields each forked child’s server object. The server will not be started nor will signals be caught.
Returns the pids of the created HighPerformanceServer children.
Typical usage:
WEBrick::HighPerformanceServer.create do |server|
server.mount '/', WEBrick::HTTPServlet::FileHandler,
'/usr/local/www/data'
trap 'INT' do server.shutdown end
trap 'TERM' do server.shutdown end
server.start
end