October 2018
Intermediate to advanced
420 pages
10h 26m
English
There are two blocks needed to use the encoder driver:
The initialization must provide the storage path present in the configuration file. This is straightforward:
encode_init = ( config .map(lambda i: encoder.Initialize(storage_path=i.encode.storage_path)))
Then, the encoding requests must be created each time an HTTP request comes in. Here is the code for doing this:
encode_request = ( sources.httpd.route .filter(lambda i: i.id='flac_transcode') .flat_map(lambda i: i.request) .map(lambda i: encoder.EncodeMp3( id=i.context, data=i.data, key=i.match_info['key'])))
The HTTP requests are emitted on the route observable of the source of the httpd driver. Only ...