Class: Thrift::BaseServer

Inherits:
Object
  • Object
show all
Defined in:
lib/thrift/server/base_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(processor, server_transport, transport_factory = nil, protocol_factory = nil) ⇒ BaseServer

Returns a new instance of BaseServer.



22
23
24
25
26
27
# File 'lib/thrift/server/base_server.rb', line 22

def initialize(processor, server_transport, transport_factory=nil, protocol_factory=nil)
  @processor = processor
  @server_transport = server_transport
  @transport_factory = transport_factory ? transport_factory : Thrift::BaseTransportFactory.new
  @protocol_factory = protocol_factory ? protocol_factory : Thrift::BinaryProtocolFactory.new
end

Instance Method Details

#serveObject

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/thrift/server/base_server.rb', line 29

def serve
  raise NotImplementedError
end

#to_sObject



33
34
35
# File 'lib/thrift/server/base_server.rb', line 33

def to_s
  "server(#{@protocol_factory.to_s}(#{@transport_factory.to_s}(#{@server_transport.to_s})))"
end