Class: IdService::Server
- Inherits:
-
Thrift::SimpleServer
- Object
- Thrift::SimpleServer
- IdService::Server
- Defined in:
- lib/id_service/server.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#worker ⇒ Object
readonly
Returns the value of attribute worker.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(options = {}) ⇒ Server
Returns a new instance of Server.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/id_service/server.rb', line 15 def initialize( = {}) .symbolize_keys! \ unless [:config].nil? = parse_config([:config]).merge() end = .merge() .each { |key, value| instance_variable_set('@' + key.to_s, value) } @handler = IdGenerator.new() @processor = IdService::Processor.new(@handler) @server_transport = Thrift::ServerSocket.new([:hostname], [:port].to_s) @transport_factory = Thrift::BufferedTransportFactory.new() @protocol_factory = Thrift::BinaryProtocolFactory.new end |
Instance Attribute Details
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
13 14 15 |
# File 'lib/id_service/server.rb', line 13 def debug @debug end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
13 14 15 |
# File 'lib/id_service/server.rb', line 13 def host @host end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
13 14 15 |
# File 'lib/id_service/server.rb', line 13 def hostname @hostname end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
13 14 15 |
# File 'lib/id_service/server.rb', line 13 def port @port end |
#worker ⇒ Object (readonly)
Returns the value of attribute worker.
13 14 15 |
# File 'lib/id_service/server.rb', line 13 def worker @worker end |