Parent

Methods

Thrift::MongrelHTTPServer::Handler

Public Class Methods

new(processor, protocol_factory) click to toggle source
# File lib/thrift/server/mongrel_http_server.rb, line 26
def initialize(processor, protocol_factory)
  @processor = processor
  @protocol_factory = protocol_factory
end

Public Instance Methods

process(request, response) click to toggle source
# File lib/thrift/server/mongrel_http_server.rb, line 31
def process(request, response)
  if request.params["REQUEST_METHOD"] == "POST"
    response.start(200) do |head, out|
      head["Content-Type"] = "application/x-thrift"
      transport = IOStreamTransport.new request.body, out
      protocol = @protocol_factory.get_protocol transport
      @processor.process protocol, protocol
    end
  else
    response.start(404) { }
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.