Skip to content

Instantly share code, notes, and snippets.

View liutaihua's full-sized avatar

LiuTaihua liutaihua

View GitHub Profile
@tzuryby
tzuryby / asynciostream.py
Created July 5, 2011 06:36
Tornado IO Stream Handler
class StreamHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
def get(self):
self.post()
@tornado.web.asynchronous
def post(self):
self.ioloop = tornado.ioloop.IOLoop.instance()
self.pipe = self.get_pipe()
self.ioloop.add_handler(