Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Latest commit 8ddc3e2 @simonrad simonrad Update readme
Failed to load latest commit information. Make sure we are on the master greenlet before we switch. Update readme


An easy way to seamlessly use Greenlet with Tornado.

This allows you to write code as if it were synchronous, and not worry about callbacks at all. You also don't have to use any special patterns, such as writing everything as a generator.

Overall this allows you to structure your program in a much more sensible, straightforward way. It's also immensely helpful when porting synchronous code to Tornado.

Derived from this blog article:

Example Usage:

import tornado.web
from greenlet_tornado import greenlet_asynchronous, greenlet_fetch

class ExampleHandler(tornado.web.RequestHandler):
    def get(self):
        # ...
        # ...
        self.write("Hello World!")

    def helper(self):
        # Fetch something. greenlet_fetch() will block until the request is complete,
        # but the tornado IOLoop can do other things in the meantime.
        http_response = greenlet_fetch("")
        # ... Do something with the response ...
Something went wrong with that request. Please try again.