DEV Community

loading...
Cover image for Tornado : ASYNC Framework for Python

Tornado : ASYNC Framework for Python

Bek Brace
Hey everyone ๐Ÿ‘‹, this is Bek Brace. I teach programming on YouTube. Love coffee, ramen and Atlanta Hawks!I speak 5 Human languages and several Computer languages.
ใƒป2 min read

Tornado is a Python open source framework, but also an asynchronous networking library, and it was originally developed for a company called FriendFeed, which was acquired by Facebook recently in 2009. To understand Tornado we need to know what is it good for.

Make sure to check out my last video on tornado Framework

Tornado is ideal for building apps asking for high performance and several thousand concurrent users; it can handle 10K connections at once, in addition to that it's non-blocking network IO. Asynchronous programming was introduced to python since python 3.5 when the asyncio library was introduced.

Before anything, you need to know that Asynchronous programming, more specifically async syntax makes you code faster to execute.

Async is a way of Concurrent ProgrammingAsync is one way of doing concurrent programming, which means doing many things at once or achieving multiple tasks at once.

How does Python achieve multiple tasks at once ?

1 OS makes multi-sharing and multi-tasking happen: One way is to run multiple terminal instances and run your server, and all of them will work concurrently in the same time; and your operating system takes care of sharing your CPU resources among those terminal instances.

2 Another way of achieving multiple tasks at once is by using threads. A thread is a line of execution for several instructions which means that they all share access to common resources, and here the operating system intervens to share your CPU with these threads

3 The last way is asynchronous programming which what Tornado does, even though the opperating system will not have any role here, yet we'll be able to achieve multiple things at once with asynchronous programming

Drop your comment or contact me on: info@bekbrace.com
Github page: https://github.com/BekBraceโ€‹

Thank you for reading and watching
Until next time - Peace out,
Bek

Discussion (0)