Tornado: A Powerful Python Web Framework and Asynchronous Library
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. It utilizes non-blocking I/O to efficiently handle tens of thousands of open connections. This makes it an ideal choice for applications requiring long-lived connections, such as long polling, WebSockets, and real-time services.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. It stands out for its use of non-blocking network I/O, enabling it to scale efficiently to tens of thousands of open connections. This makes Tornado an excellent choice for applications that require persistent connections, such as long polling, WebSockets, and real-time services.
Installation
Getting started with Tornado is straightforward. You can install it using pip:
pip install tornado
Examples
This simple "Hello, world" example demonstrates a basic web application with Tornado:
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 more advanced asynchronous features and real-time applications, explore the simple chat room demo.
Why Use Tornado
Tornado's non-blocking architecture provides significant advantages for specific types of applications. It excels in scenarios requiring high concurrency and persistent connections, offering superior performance for services like real-time dashboards, chat applications, and APIs that leverage long polling or WebSockets. Its lightweight nature and direct control over network operations also appeal to developers seeking fine-grained performance tuning.
Links
- Official Documentation: https://www.tornadoweb.org
- GitHub Repository: https://github.com/tornadoweb/tornado
Related repositories
Similar repositories that may be relevant next.
Source repository
Open the original repository on GitHub.
