In this recipe, we will pass queues around different modules. As our GUI code increases in complexity, we want to separate the GUI components from the business logic, separating them out into different modules. Modularization allows us to reuse code and also makes the code more readable.
Once the data to be displayed in our GUI comes from different data sources, we will face latency issues, which is what queues solve. By passing instances of Queue among different Python modules, we are separating the different concerns of the modules' functionalities.
The GUI code ideally would only be concerned with creating and displaying widgets and data.
The business logic modules' job is only to do the business logic and supply the resulting data to the GUI.
The business logic modules' job is only to do the business logic and supply the resulting data to the GUI.
We have to combine the two elements, ideally using as few relationships among the...