Building concurrent applications with Tornado Future
Tornado Future construct allows us to develop non-blocking and asynchronous calls in a more efficient way. In this recipe, we will develop a simple asynchronous application based on Tornado Future constructs.
Note
To learn more about the concurrent and asynchronous applications in Tornado with Future, please visit: http://www.tornadoweb.org/en/stable/concurrent.html.
Getting ready
Tornado is a web framework. In order to execute this recipe, first you need to install Tornado in your computer, which can be done by using the following command in Linux environments:
$ sudo pip install tornado
How to do it...
We will build a concurrent application to illustrate the functionality of Tornado. In this example, the tornado.concurrent
module of Tornado has been used.
Listing 4.13 explains the code for a simple concurrent application using Tornado:
#!/usr/bin/env python # Python Network Programming Cookbook, Second Edition -- Chapter - 3 # This program...