Summary

This chapter concludes the implementation of the audio-transcoding server. This application is now robust enough to be used in production. The two parts studied in this chapter provide other examples of how to use RxPY in non-trivial cases.

The usage of aionotify is another example of how to integrate an AsyncIO package with RxPY, and in a functional way. inotify is different from the other drivers that have been written before because it does not implement a request/response communication pattern, but an observer one (which is more similar to ReactiveX observables). With this example, you should now be able to use any AsyncIO package in an RxPY application.

The second part covers a very important aspect of any serious application—error management. More specifically, the snippets used to describe how to manage errors in Chapter 4Exploring Observables and Observers, are not enough to handle errors in an application like this one. The correct handling of errors in this cases requires more abstractions. This translates to the usage of higher-order functions and higher-order observables. Splitting the behavior into several helper functions makes the code using these functions more readable.

A last word on readability—the audio_encoder function is now quite big, too big. As an exercise, try to split it into several functions or even components to make it smaller.

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

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