Now, we can run the async_api.py
script that launches Tornados's development server to compose and send HTTP requests to our new version of the Web API that uses the non-blocking features of Tornado combined with asynchronous execution. Execute the following command:
python async_api.py
The following lines show the output after we execute the previous command. The Tornado HTTP development server is listening at port 8888
:
Listening at port 8888
With the previous command, we will start the Tornado HTTP server and it will listen on every interface on port 8888
. Thus, if we want to make HTTP requests to our API from other computers or devices connected to our LAN, we don't need any additional configurations.
In our new version of the API, each HTTP request is non-blocking. Thus, whenever the Tornado HTTP server receives an HTTP request and makes an asynchronous call, it is able to start working on any other HTTP request in the incoming queue...