Tornado
Python web framework and asynchronous networking library built for high concurrency
Repository Health
Technical Analysis
Tornado is a Python web framework and asynchronous networking library, originally built at FriendFeed to handle tens of thousands of simultaneous long-lived connections. Unlike traditional WSGI frameworks, it uses a non-blocking network I/O model, making it well suited for applications that need to hold many concurrent connections open, such as WebSockets, long polling, and other real-time features, without spawning a thread per connection.
The framework bundles its own event loop (IOLoop), an async HTTP client and server, a request-handler-based web application layer (tornado.web), and coroutine-friendly utilities (tornado.gen, tornado.queues, tornado.locks) that predate and later integrated with Python’s native asyncio. Tornado remains widely deployed for real-time dashboards, chat/notification services, and APIs that need fine-grained control over connection lifecycle and concurrency.
What You Get
- A
tornado.webapplication layer withRequestHandlerclasses, URL routing, and Jinja-like templating - An
IOLoop-based non-blocking event loop that integrates with Python’sasyncio - Built-in async HTTP client (
httpclient,simple_httpclient, optionalcurl_httpclient) and HTTP server (httpserver,tcpserver) - Native WebSocket support (
tornado.websocket) for bidirectional real-time connections - Coroutine utilities (
tornado.gen,tornado.queues,tornado.locks) and atestingmodule for writing async test cases
Common Use Cases
- Real-time services that need many concurrent long-lived connections, such as chat, notifications, or live dashboards over WebSockets
- Long-polling APIs where connections stay open waiting for server-side events rather than closing immediately after a response
- Lightweight async web services where fine-grained control over the event loop and connection handling matters more than a large plugin ecosystem
- Async HTTP client usage independent of the web framework, via
tornado.httpclient, in scripts or services that need non-blocking outbound requests
Under The Hood
Architecture: Tornado layers a web framework on top of its own networking stack: tcpserver.py/httpserver.py/http1connection.py implement the non-blocking socket and HTTP protocol handling, ioloop.py provides the event loop that everything else schedules work on, and web.py implements the RequestHandler/Application abstractions that most users interact with directly. routing.py maps URLs to handlers, and websocket.py implements the WebSocket protocol on top of the same connection primitives.
Tech Stack: Python with an optional C extension (speedups.c) for performance-sensitive parsing paths, plus platform-specific event loop backends under tornado/platform/. It has long since converged with Python’s native asyncio, so modern Tornado applications can mix async/await coroutines with Tornado’s own gen.coroutine utilities and IOLoop.
Code Quality: The tornado/test/ directory contains an extensive test suite covering the web layer, HTTP client/server, WebSocket protocol, and platform-specific IOLoop implementations; the project ships type stubs (py.typed, .pyi files) for static type checking and has been continuously maintained with active commits since its 2009 FriendFeed origins.
API Design: The web layer’s core pattern — subclass RequestHandler, implement get()/post() methods, register with an Application URL spec — is simple and well documented, though developers coming from synchronous frameworks need to learn Tornado’s coroutine/callback idioms (now largely asyncio-compatible) to use it effectively for concurrent I/O.
Used by 5 apps in this directory
argilla
AI Development · Data Engineering
Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.
MLflow
AI Development · Monitoring
The open source AI engineering platform for debugging, evaluating, monitoring, and optimizing production LLMs and agents at scale.
OpenHands
AI Code Assistants · AI Development
The self-hosted developer control center for running AI coding agents — locally, in Docker, on VMs, or across cloud backends — with automation workflows for GitHub, Slack, and more.
Skyvern
AI Agents · Automation
Skyvern (YC S2023) automates browser-based workflows by pairing LLMs with computer vision, letting agents click, fill, and extract data on sites they've never seen, without brittle XPath selectors that break on every layout change.
SurfSense
Search · AI Assistants
The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.