What Tornado Does
- Non-blocking I/O — event loop based
- Web framework — routing, templates, auth, XSRF
- WebSocket — native support
- HTTP client — async HTTP requests
- Coroutines —
async def/await(modern) orgen.coroutine(legacy) - asyncio compatible — integrates with Python asyncio loop
Comparison
| Framework | Async Model | WebSocket | Era |
|---|---|---|---|
| Tornado | IOLoop (asyncio) | Built-in | 2009 |
| FastAPI | ASGI (asyncio) | Via Starlette | 2018 |
| Sanic | uvloop | Built-in | 2016 |
| aiohttp | asyncio | Built-in | 2014 |
常见问题 FAQ
Q: 新项目还用 Tornado 吗? A: 新项目推荐 FastAPI 或 Starlette。Tornado 主要维护老项目或需要自定义 IOLoop 的场景。
来源与致谢 Sources
- Docs: https://www.tornadoweb.org
- GitHub: https://github.com/tornadoweb/tornado
- License: Apache 2.0