Assuming you are processing a live stream of data like this:
What would be the best way to have a background Thread
to update the data
variable while the main logic can do_some_logic
within the endless loop?
I have some experience with clear start and end point of parallelization using multiprocessing/multithreading
, but I am unsure how to continously execute a background Thread updating an internal variable. Any advice would be helpfull - Thanks!