Class: Rack::Handler::Mongrel2
- Inherits:
-
Object
- Object
- Rack::Handler::Mongrel2
- Defined in:
- lib/rack/handler/mongrel2.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ 'recv_addr' => 'tcp://127.0.0.1:9997', 'send_addr' => 'tcp://127.0.0.1:9996', 'sender_id' => SecureRandom.uuid }
Class Method Summary collapse
Class Method Details
.connection_factory(options) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rack/handler/mongrel2.rb', line 30 def self.connection_factory() klass = if custom = .connection_factory begin M2R::ConnectionFactory.const_get(custom.classify) rescue NameError require "m2r/connection_factory/#{custom.underscore}" M2R::ConnectionFactory.const_get(custom.classify) end else M2R::ConnectionFactory end klass.new() end |
.run(app, options = {}) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/rack/handler/mongrel2.rb', line 15 def self.run(app, = {}) = OpenStruct.new( DEFAULT_OPTIONS.merge() ) parser = M2R::Request adapter = M2R::RackHandler.new(app, connection_factory(), parser) adapter.listen end |
.valid_options ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/rack/handler/mongrel2.rb', line 22 def self. { 'recv_addr=RECV_ADDR' => 'Receive address', 'send_addr=SEND_ADDR' => 'Send address', 'sender_id=UUID' => 'Sender UUID' } end |