Tornado (web server)
Appearance
move to sidebar
hide
Tornado is a scalable, non-blocking web server and web application framework written in Python. It was developed for use by FriendFeed; the company was acquired by Facebook in 2009 and Tornado was open-sourced soon after.
Performance
Tornado is noted for its high performance. Its design enables handling a large number of concurrent connections (i.e., tries to solve the "C10k problem").
Modules
- An asynchronous MongoDB driver called Motor.
- CouchDB drivers called corduroy and trombi.
- Asynchronous driver for PostgreSQL wrapping psycopg called Momoko
Example
The following code shows a simple web application that displays "Hello World!" when visited:
import asyncio
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
def make_app():
return tornado.web.Application()
async def main():
app = make_app()
app.listen(8888)
await asyncio.Event().wait()
if __name__ == "__main__":
asyncio.run(main())
See also
References
- ^ "Release 6.4.1". 6 June 2024. Retrieved 27 June 2024.
- ^ "Home - tornado - GitHub". GitHub. Retrieved 2009-09-10.
- ^ "Facebook open-sources real-time FriendFeed facet". CNet. Archived from the original on 2012-01-30. Retrieved 2009-09-10.
- ^ "Hello, world". Retrieved 2022-09-14.
External links
Meta Platforms |
---|
Products and services | |
---|
People | Founders |
|
---|
Board | |
---|
Executive officers | |
---|
Oversight Board | Members |
|
---|
Board of Trustees |
|
---|
Former members |
|
---|
|
---|
Notable employees | |
---|
|
---|
Open source |
|
---|
Mass media |
|
---|
Concepts |
|
---|
Business |
|
---|
Lists |
|
---|
Related |
|
---|