Tornado (web server)
Appearance
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
Original author(s) | FriendFeed |
---|---|
Developer(s) | Ben Darnell, Meta, Bret Taylor |
Initial release | 2009 |
Stable release | 6.4.1[1]
/ 6 June 2024 |
Apache licence 2.0 | |
Website | www |
Tornado is a scalable,
open-sourced soon after.[3]
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.
- CouchDBdrivers 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:[4]
import asyncio
import tornado.web
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())
See also
- Django (web framework)
- FastAPI
- Flask (web framework)
- Jam.py
- Pylons project
- Web2py
- Comparison of web server software
References
- ^ "Release 6.4.1". 6 June 2024. Retrieved 27 June 2024.
- ^ "Home - tornado - GitHub". GitHub. Retrieved 2009-09-10.
- CNet. Archived from the originalon 2012-01-30. Retrieved 2009-09-10.
- ^ "Hello, world". Retrieved 2022-09-14.