facebook/tornado — pull request #580 by ei-grad (2012-08-09 19:12:06+00:00)
Title: Added gen.task decorator

It provides more straight-forward usage of gen.Task interface.

Example:
```python
from functools import wraps

from tornado import gen, web
from tornado.ioloop import IOLoop
from tornado.httpserver import HTTPServer

@gen.task
def worker(name, callback):
callback('Hello, %s!' % name)

class MainHandler(web.RequestHandler):

@web.asynchronous
@gen.engine
def get(self):
result = yield worker('world')
self.finish(result)

application = web.Application([
(r"/", MainHandler),
])

if __name__ == "__main__":
server = HTTPServer(application)
server.bind(8888)
server.start(4)
IOLoop.instance().start()
```