November 2018
Beginner
472 pages
13h 5m
English
Our image service works, but has a major flaw. If we want our robot to be doing something, even when the network is not perfect, we need to be able to run a behavior in parallel with this. That behavior needs access to the image data, as well as the server too.
We will approach this by making the Flask web app a secondary process, with the behavior as the primary process for the robot when it is running. Python has a handy tool for exactly this kind of structure, called multiprocessing. Find out more at https://docs.python.org/2/library/multiprocessing.html.
Communicating between multiple processes is tricky. If two processes try to access (read or write) the same data at the same time, the results can be ...
Read now
Unlock full access