I am implementing Python Queue
with Thread
. I need a way to get the total count of items currently in the queue (which I can get with queue.qsize()
) and the count of unfinished tasks. Basically I need a count of all items that are being processed/need to be processed. The Python Queue documentation mentions the following:
The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a consumer thread calls task_done() to indicate that the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, join() unblocks.
But it offers no insight as to how to access that count. Thanks in advance!