Class: Launch::WEBrickHTTPServer
- Inherits:
-
WEBrick::HTTPServer
- Object
- WEBrick::HTTPServer
- Launch::WEBrickHTTPServer
- Defined in:
- lib/launch/webrick.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ WEBrickHTTPServer
constructor
Initializes an HTTP server with
options
and set the server’s listeners using Launch.
Constructor Details
#initialize(options = {}) ⇒ WEBrickHTTPServer
Initializes an HTTP server with options
and set the server’s listeners using Launch. A TERM handler to shut down the server is automatically set.
:LaunchdSockets
may be set to change the socket key from the default of 'WEBrickSockets'
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/launch/webrick.rb', line 59 def initialize( = {}) [:DoNotListen] = true sockets_key = .delete(:LaunchdSockets) || 'WEBrickSockets' super @job = Launch::Job.checkin sockets = @job.sockets[sockets_key] listeners.replace(socket) trap("TERM") { shutdown } end |