← Back to archive

Repo of the Day

tornadoweb/tornado

Published: Dec 26, 2023

Open repository ↗

Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Summary

Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. It uses non-blocking network I/O so a single server can handle a large number of open connections, which makes it a fit for applications that keep connections alive rather than just doing short request-response exchanges.

What it is useful for

The README describes Tornado as ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user. Because the framework uses non-blocking I/O, the README states it can scale to tens of thousands of open connections. Concretely, that means services such as chat backends, notification streams, or any app where the server pushes data to clients over a connection that stays open are the kinds of workloads the project is designed for. Beyond HTTP request handling, the project is also documented as an asynchronous networking library, so it can be used for lower-level networking code as well as full web apps.

How engineers can use it

The README includes a minimal "Hello, world" web app that engineers can copy as a starting point. It defines a tornado.web.RequestHandler subclass with a get method, registers URL patterns through tornado.web.Application, and calls app.listen(8888) to bind a port. The whole entry point is an async function driven with asyncio.run, which shows how Tornado fits with the standard asyncio event loop.

For the asynchronous features the README says this small example does not exercise, the README points to a simple chat room demo in the demos/chat directory on the stable branch, which illustrates long-lived connections in practice. The README does not include explicit installation or dependency commands, so setup steps should be checked in the documentation at https://www.tornadoweb.org. Engineers should also note that the example in the README deliberately avoids Tornado's async features, so production code will need additional patterns from the docs and demos to handle concurrent connections properly. The project is licensed under Apache-2.0 and is not archived.