Class: RailsRunner

Inherits:
Net::AJP13::Server
  • Object
show all
Defined in:
lib/ajp-rails/rails-runner.rb

Overview

AJP server that dispatches AJP requests into Rails.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ RailsRunner

option

Hash which contains server-wide options.



27
28
29
30
# File 'lib/ajp-rails/rails-runner.rb', line 27

def initialize(options)
  super(options['BIND_IP'], options['AJP_PORT'])
  @environment_options = options
end

Instance Method Details

#process_request(request) ⇒ Object

Dispatches request into Rails and returns Net::AJP13::Response object which contains the result of Rails processing.

request

Net::AJP13::Request object



36
37
38
39
40
41
# File 'lib/ajp-rails/rails-runner.rb', line 36

def process_request(request)
  logger.debug("processing #{request.path}")
  response = AjpRailsDispatcher.dispatch(request, AjpRailsRequest::DEFAULT_SESSION_OPTIONS, @environment_options)
  logger.debug("processed #{request.path}: #{response.code} #{response.message}")
  response
end