Class: Nitro::Mongrel
- Inherits:
-
Object
- Object
- Nitro::Mongrel
- Defined in:
- lib/nitro/adapter/mongrel.rb
Class Attribute Summary collapse
-
.mongrel ⇒ Object
Returns the value of attribute mongrel.
-
.mongrel_config ⇒ Object
Returns the value of attribute mongrel_config.
Class Method Summary collapse
-
.initialize_mongrel(server) ⇒ Object
Override this method to perform customized mongrel initialization.
-
.start(server) ⇒ Object
Start the Mongrel adapter.
-
.stop(server = nil) ⇒ Object
Stop the Mongrel adapter.
Class Attribute Details
.mongrel ⇒ Object
Returns the value of attribute mongrel.
45 46 47 |
# File 'lib/nitro/adapter/mongrel.rb', line 45 def mongrel @mongrel end |
.mongrel_config ⇒ Object
Returns the value of attribute mongrel_config.
46 47 48 |
# File 'lib/nitro/adapter/mongrel.rb', line 46 def mongrel_config @mongrel_config end |
Class Method Details
.initialize_mongrel(server) ⇒ Object
Override this method to perform customized mongrel initialization.
75 76 |
# File 'lib/nitro/adapter/mongrel.rb', line 75 def initialize_mongrel(server) end |
.start(server) ⇒ Object
Start the Mongrel adapter.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/nitro/adapter/mongrel.rb', line 50 def start(server) # TODO add logging. @mongrel_config = ::Mongrel::Configurator.new :host => server.address do listener :port => server.port do uri "/", :handler => MongrelAdapter.new(server) trap('INT') { Nitro::Mongrel.stop(server) } run end end @mongrel_config.log("Started Mongrel on " + server.address + ":" + server.port.to_s) @mongrel_config.join end |
.stop(server = nil) ⇒ Object
Stop the Mongrel adapter.
67 68 69 70 |
# File 'lib/nitro/adapter/mongrel.rb', line 67 def stop(server = nil) @mongrel_config.log("Stopped Mongrel on " + server.address + ":" + server.port.to_s) @mongrel_config.stop end |