Blocks until all items in the Queue have been gotten and processed. 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 the item was retrieved and all work on it is complet
(self)
| 92 | self.unfinished_tasks = unfinished |
| 93 | |
| 94 | def join(self): |
| 95 | '''Blocks until all items in the Queue have been gotten and processed. |
| 96 | |
| 97 | The count of unfinished tasks goes up whenever an item is added to the |
| 98 | queue. The count goes down whenever a consumer thread calls task_done() |
| 99 | to indicate the item was retrieved and all work on it is complete. |
| 100 | |
| 101 | When the count of unfinished tasks drops to zero, join() unblocks. |
| 102 | ''' |
| 103 | with self.all_tasks_done: |
| 104 | while self.unfinished_tasks: |
| 105 | self.all_tasks_done.wait() |
| 106 | |
| 107 | def qsize(self): |
| 108 | '''Return the approximate size of the queue (not reliable!).''' |