Class: IdService::Server

Inherits:
Thrift::SimpleServer
  • Object
show all
Defined in:
lib/id_service/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Server



12
13
14
15
16
17
18
19
20
21
# File 'lib/id_service/server.rb', line 12

def initialize(options = {})
  options.symbolize_keys!
  options = default_options.merge(options)

  @handler = IdGenerator.new(options)
  @processor = IdService::Processor.new(@handler)
  @server_transport = Thrift::ServerSocket.new(options[:hostname], options[:port].to_s)
  @transport_factory = Thrift::BufferedTransportFactory.new()
  @protocol_factory = Thrift::BinaryProtocolFactory.new
end