Class: Thrift::ThinHTTPServer
- Inherits:
-
BaseServer
- Object
- BaseServer
- Thrift::ThinHTTPServer
- Defined in:
- lib/thrift/server/thin_http_server.rb
Defined Under Namespace
Classes: RackApplication
Instance Method Summary collapse
-
#initialize(processor, options = {}) ⇒ ThinHTTPServer
constructor
Accepts a Thrift::Processor Options include: * :port * :ip * :path * :protocol_factory.
-
#serve ⇒ Object
Starts the server.
Methods inherited from BaseServer
Constructor Details
#initialize(processor, options = {}) ⇒ ThinHTTPServer
Accepts a Thrift::Processor Options include:
-
:port
-
:ip
-
:path
-
:protocol_factory
35 36 37 38 39 40 41 42 |
# File 'lib/thrift/server/thin_http_server.rb', line 35 def initialize(processor, ={}) port = [:port] || 80 ip = [:ip] || "0.0.0.0" path = [:path] || "/" protocol_factory = [:protocol_factory] || BinaryProtocolFactory.new app = RackApplication.for(path, processor, protocol_factory) @server = Thin::Server.new(ip, port, app) end |
Instance Method Details
#serve ⇒ Object
Starts the server
46 47 48 |
# File 'lib/thrift/server/thin_http_server.rb', line 46 def serve @server.start end |