blob: b712fcd7f95633ce3ac1c3ba91f1cd17ab925f32 [file] [log] [blame]
ra779b9ac2014-04-23 20:04:23 -07001import sys
2sys.path.append('gen-py')
3
4from hello import HelloSvc
5from thrift.protocol import TJSONProtocol
6from thrift.server import THttpServer
7
8class HelloSvcHandler:
9 def hello_func(self):
cclauss4bd36822017-09-01 17:40:29 +020010 print("Hello Called")
ra779b9ac2014-04-23 20:04:23 -070011 return "hello from Python"
12
13processor = HelloSvc.Processor(HelloSvcHandler())
14protoFactory = TJSONProtocol.TJSONProtocolFactory()
15port = 9090
16server = THttpServer.THttpServer(processor, ("localhost", port), protoFactory)
17print "Python server running on port " + str(port)
18server.serve()