gitmyhub

tornado

Python ★ 22k updated 16d ago

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

Tornado is a Python web framework built for high concurrency, it handles tens of thousands of simultaneous connections using non-blocking async I/O, making it ideal for real-time apps like chat, live dashboards, and push notification systems.

Pythonasynciosetup: easycomplexity 3/5

Tornado is a Python web framework and networking library designed to handle a very large number of simultaneous connections efficiently. While many web frameworks handle one request at a time using a process or thread per request (which can get slow and memory-hungry at scale), Tornado takes a different approach: non-blocking I/O. This means it can handle tens of thousands of open connections at once without dedicating a separate thread to each one.

This makes Tornado particularly well-suited for use cases where connections stay open for a long time — for example, long polling (where a browser keeps a connection open waiting for the server to push new data), WebSockets (a protocol for real-time two-way communication between a browser and server), or any application that needs to push live updates to many users simultaneously. A chat application is a classic example.

Tornado is built on top of Python's asyncio system (the standard library's toolkit for writing asynchronous code), which means you use the standard async/await syntax to write handlers that don't block while waiting for network operations. A basic web server in Tornado involves defining a request handler class with methods for each HTTP verb (GET, POST, etc.) and registering URL routes that map web addresses to those handlers.

You would choose Tornado when building a real-time or streaming web application in Python that needs to hold many connections open simultaneously — for example, a live dashboard, a chat service, or a notification system. Tornado was originally developed at FriendFeed and is written in Python.

Where it fits