I have never tried multi-threaded programming in Python. I am trying to achieve the following:
From my main thread, I want to spawn a child thread which downloads data in the background.
I have multiple data download tasks, for example, task1, task2, task3, ... These tasks are triggered by events in the main application. I want to queue these tasks in the background to be performed sequentially in a separate thread. Also if any task (for example task1) is done or already in queue then don't schedule it in the queue.
Can someone help provide a sample code snippet on how to achieve this.