Class Thrift::MongrelHTTPServer::Handler
In: lib/thrift/server/mongrel_http_server.rb
lib/thrift/server/mongrel_http_server.rb
Parent: Mongrel::HttpHandler

Methods

new   new   process   process  

Public Class methods

[Source]

    # File lib/thrift/server/mongrel_http_server.rb, line 26
26:       def initialize(processor, protocol_factory)
27:         @processor = processor
28:         @protocol_factory = protocol_factory
29:       end

[Source]

    # File lib/thrift/server/mongrel_http_server.rb, line 26
26:       def initialize(processor, protocol_factory)
27:         @processor = processor
28:         @protocol_factory = protocol_factory
29:       end

Public Instance methods

[Source]

    # File lib/thrift/server/mongrel_http_server.rb, line 31
31:       def process(request, response)
32:         if request.params["REQUEST_METHOD"] == "POST"
33:           response.start(200) do |head, out|
34:             head["Content-Type"] = "application/x-thrift"
35:             transport = IOStreamTransport.new request.body, out
36:             protocol = @protocol_factory.get_protocol transport
37:             @processor.process protocol, protocol
38:           end
39:         else
40:           response.start(404) { }
41:         end
42:       end

[Source]

    # File lib/thrift/server/mongrel_http_server.rb, line 31
31:       def process(request, response)
32:         if request.params["REQUEST_METHOD"] == "POST"
33:           response.start(200) do |head, out|
34:             head["Content-Type"] = "application/x-thrift"
35:             transport = IOStreamTransport.new request.body, out
36:             protocol = @protocol_factory.get_protocol transport
37:             @processor.process protocol, protocol
38:           end
39:         else
40:           response.start(404) { }
41:         end
42:       end

[Validate]