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.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/id_service/server.rb', line 14 def initialize( = {}) .symbolize_keys! = .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.
12 13 14 |
# File 'lib/id_service/server.rb', line 12 def debug @debug end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
12 13 14 |
# File 'lib/id_service/server.rb', line 12 def host @host end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
12 13 14 |
# File 'lib/id_service/server.rb', line 12 def hostname @hostname end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
12 13 14 |
# File 'lib/id_service/server.rb', line 12 def port @port end |
#worker ⇒ Object (readonly)
Returns the value of attribute worker.
12 13 14 |
# File 'lib/id_service/server.rb', line 12 def worker @worker end |