In this chapter, we understood the difference between synchronous and asynchronous execution. We created a new version of the RESTful API that takes advantage of the non-blocking features in Tornado combined with asynchronous execution. We improved scalability for our existing API and we made it possible to start executing other requests while waiting for the slow I/O operations with sensors and actuators. We avoided splitting our methods into multiple methods with callbacks by using the tornado.gen
generator-based interface that Tornado provides to make it easier to work in an asynchronous environment.
Then, we set up a testing environment. We installed nose2 to make it easy to discover and execute unit tests. We wrote a first round of unit tests, measured test coverage, and then we wrote additional unit tests to improve test coverage. We created all the necessary tests to have a complete coverage of all the lines of code.
We built RESTful Web Services with Django, Flask, and Tornado...