diff options
Diffstat (limited to 'src/jaegertracing/thrift/contrib/async-test/test-leaf.py')
-rwxr-xr-x | src/jaegertracing/thrift/contrib/async-test/test-leaf.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/jaegertracing/thrift/contrib/async-test/test-leaf.py b/src/jaegertracing/thrift/contrib/async-test/test-leaf.py new file mode 100755 index 000000000..4ea4a9b8c --- /dev/null +++ b/src/jaegertracing/thrift/contrib/async-test/test-leaf.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +import sys +import time +from thrift.transport import TTransport +from thrift.transport import TSocket +from thrift.protocol import TBinaryProtocol +from thrift.server import THttpServer +from aggr import Aggr + + +class AggrHandler(Aggr.Iface): + def __init__(self): + self.values = [] + + def addValue(self, value): + self.values.append(value) + + def getValues(self, ): + time.sleep(1) + return self.values + +processor = Aggr.Processor(AggrHandler()) +pfactory = TBinaryProtocol.TBinaryProtocolFactory() +THttpServer.THttpServer(processor, ('', int(sys.argv[1])), pfactory).serve() |