Class: Thrift::MongrelHTTPServer

Inherits:
BaseServer show all
Defined in:
lib/thrift/server/mongrel_http_server.rb

Defined Under Namespace

Classes: Handler

Instance Method Summary collapse

Methods inherited from BaseServer

#to_s

Constructor Details

#initialize(processor, opts = {}) ⇒ MongrelHTTPServer

Returns a new instance of MongrelHTTPServer.



46
47
48
49
50
51
52
53
54
# File 'lib/thrift/server/mongrel_http_server.rb', line 46

def initialize(processor, opts={})
  Kernel.warn "[DEPRECATION WARNING] `Thrift::MongrelHTTPServer` is deprecated.  Please use `Thrift::ThinHTTPServer` instead."
  port = opts[:port] || 80
  ip = opts[:ip] || "0.0.0.0"
  path = opts[:path] || ""
  protocol_factory = opts[:protocol_factory] || BinaryProtocolFactory.new
  @server = Mongrel::HttpServer.new ip, port
  @server.register "/#{path}", Handler.new(processor, protocol_factory)
end

Instance Method Details

#serveObject



56
57
58
# File 'lib/thrift/server/mongrel_http_server.rb', line 56

def serve
  @server.run.join
end