October 2018
Intermediate to advanced
420 pages
10h 26m
English
Now that the driver implementation is done, one has to instantiate it. As explained in the Observable cycles section, this server contains an observable cycle. This cycle is handled with Subject. Here is the code for the bootstrapping phase:
http_proxy = Subject() sources = { 'http': http_driver(http_proxy, loop), } sinks = echo_server(sources) sinks["http"].subscribe(http_proxy)
The application logic of the server is implemented as a component in the echo_server function. Its implementation is detailed as follows: the source and sinks of this component are Python dictionaries that contain one field named HTTP. This field contains an observable carrying HTTP requests in the sources dictionary and HTTP responses ...
Read now
Unlock full access