class Thrift::ThinHTTPServer
Constants
- RackApplication
Public Class Methods
Source
# File lib/thrift/server/thin_http_server.rb 40 def initialize(processor, options = {}) 41 Kernel.warn "[DEPRECATION WARNING] `Thrift::ThinHTTPServer` is deprecated because Thin is no longer maintained. Please use `Thrift::RackApplication` with a maintained Rack server instead." 42 port = options[:port] || 80 43 ip = options[:ip] || "0.0.0.0" 44 path = options[:path] || "/" 45 protocol_factory = options[:protocol_factory] || BinaryProtocolFactory.new 46 endpoint = RackApplication.mapped(path, processor, protocol_factory) 47 app = Rack::Builder.new do 48 use Rack::CommonLogger 49 use Rack::ShowExceptions 50 use Rack::Lint 51 run endpoint 52 end 53 @server = Thin::Server.new(ip, port, app) 54 if options[:ssl] 55 @server.ssl = true 56 @server.ssl_options = options[:ssl_options] || {} 57 end 58 end
Accepts a Thrift::Processor Options include:
-
:port
-
:ip
-
:path
-
:protocol_factory
-
:ssl
-
:ssl_options
Public Instance Methods
Source
# File lib/thrift/server/thin_http_server.rb 62 def serve 63 @server.start 64 end
Starts the server