Summary

This chapter is an application of all the notions learned in the previous chapters. While relatively small, starting its development by using the layout of a Python package allows us to easily extend it later (which will be done in the next chapters). Also, readability tips, such as using named tuples for items types and using parentheses in operator chains, make this code even easier to follow.

Cyclotron packages are very useful when it comes to structuring code in a functional and reactive way. They avoid writing observable connection boilerplate, and provide directions to write functional code. Cyclotron allows us to write the code logic of the application as pure functions, while keeping side-effects in dedicated locations called drivers.

The audio transcoding application is quite small. It consists of only 200 lines of Python code. However, it already implements a lot of things:

  • Using a JSON file to configure it
  • Exposing HTTP APIs with an embedded server
  • Transcoding an audio file

Implementing the same application in an asynchronous way would be very challenging in many other programming languages.

The current implementation of this application should allow you to grasp how to use ReactiveX operators and combine them in practice. There are still some issues in this code, and some of them will be fixed in the following chapters. However, you should now be ready to write your own applications with RxPY.

The next chapter is dedicated to an example of dealing with non-asynchronous libraries. It explains how to use the Amazon Web Services S3 storage SDK in an asynchronous application. This will also be an opportunity to introduce Docker, a tool that will be used in Chapter 11, Deploying and Scaling Your Application, to deploy this application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.151.164