Summary
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 an asynchronous execution. We improved the scalability of our existing API and made it possible to start executing other requests while waiting for 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 pytest, along with many plugins, to make it easy to discover and execute unit ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access