* Moving from govendor to dep. * Making the pull request template more friendly. * Fixing akward space in PR template. * goimports run on whole project using ` goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./gen-go/*")` source of command: https://gist.github.com/bgentry/fd1ffef7dbde01857f66
24 lines
623 B
Python
Executable file
24 lines
623 B
Python
Executable file
#!/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()
|