tornado README

The project's README from github.com/tornadoweb/tornado. As one markdown file: README.md.

.. image:: docs/tornado.png?raw=true :alt: Tornado Web :align: center

Tornado Web Server

Tornado <http://www.tornadoweb.org>_ is a Python web framework and asynchronous networking library, originally developed at FriendFeed <http://friendfeed.com>. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling <http://en.wikipedia.org/wiki/Push_technology#Long_Polling>, WebSockets <http://en.wikipedia.org/wiki/WebSocket>_, and other applications that require a long-lived connection to each user.

Hello, world

Here is a simple "Hello, world" example web app for Tornado:

.. code-block:: python

import asyncio
import tornado

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")

def make_app():
    return tornado.web.Application([
        (r"/", MainHandler),
    ])

async def main():
    app = make_app()
    app.listen(8888)
    await asyncio.Event().wait()

if __name__ == "__main__":
    asyncio.run(main())

This example does not use any of Tornado's asynchronous features; for that see this simple chat room <https://github.com/tornadoweb/tornado/tree/stable/demos/chat>_.

Documentation

Documentation and links to additional resources are available at https://www.tornadoweb.org

tornado (tornadoweb/tornado)

Searching Database…

22.2K ·GitHub
What is this?Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. Thanks to non-blocking network I/O it can scale to tens of thousands of open connections.
Does it serve requests itself, or do I put it behind a separate web server?It serves traffic itself — the README titles it Tornado Web Server, and the sample app simply calls app.listen(8888). No separate web server is mentioned.
How do I get a minimal app running?Subclass tornado.web.RequestHandler with a get() method, wire your handlers into a tornado.web.Application, call app.listen(8888) inside an async main(), and start it with asyncio.run(main()).
Does it run on Python's asyncio, or does it bring its own event loop?It runs on Python's built-in asyncio: the example app listens, then waits on asyncio.Event().wait() inside main(), launched via asyncio.run(main()). No other dependencies are mentioned.
Do I have to write async code everywhere to use it?Not necessarily. The README notes its Hello, world example does not use any of Tornado's asynchronous features; async is introduced separately with a simple chat room example.
What kind of apps is it built for?Apps where each user stays connected: the README says it is ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user.
Where did Tornado come from?It was originally developed at FriendFeed; the GitHub repository has existed since September 2009.
Is the project still alive?By its metadata, yes: the repo is not archived, has roughly 22,000 stars, and runs GitHub Actions workflows for building and testing.
Creator
tornadoweb
Size
11.8 MB
Stars
22.2K
Updated
CommitOct 16
Age
17y
Commits · 90 Days