Created
February 9, 2011 00:01
-
-
Save reiddraper/817579 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from scribe import scribe | |
from thrift.transport import TSocket | |
from thrift.transport import TTransport | |
from thrift.protocol import TBinaryProtocol | |
from thrift.server import TServer | |
def Handler(): | |
pass | |
def Log(messages): | |
#print len(messages) | |
for m in messages: | |
print m.message.strip() | |
#return scribe.Log_result(scribe.ResultCode.OK) | |
return scribe.ResultCode.OK | |
Handler.Log = Log | |
handler = Handler | |
processor = scribe.Processor(Handler) | |
transport = TSocket.TServerSocket(9091) | |
#tfactory = TTransport.TBufferedTransportFactory() | |
tfactory = TTransport.TFramedTransportFactory() | |
pfactory = TBinaryProtocol.TBinaryProtocolFactory() | |
#server = TServer.TSimpleServer(processor, transport, tfactory, pfactory) | |
server = TServer.TThreadedServer(processor, transport, tfactory, pfactory) | |
#server = TServer.TThreadPoolServer(processor, transport, tfactory, pfactory) | |
server.serve() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment