It is now time to implement the encoding server by using all the new notions and operators that have just been covered. The following sections go into the detail of each element of the server: parsing the configuration file, encoding an MP3 file to FLAC, and serving the encoding service from an HTTP server.
Implementation of the encoding server
Parsing the configuration file
Parsing the configuration file requires three distinct parts, as shown previously in the reactivity diagram for the application:
- Parsing the command-line arguments
- Reading the configuration file
- Parsing the configuration file and converting it to a Python object
Command-line arguments are retrieved with the argv driver of the cyclotron-std package, as...