def dismissWorkers(self, num_workers):
        """Tell num_workers worker threads to to quit when they're done."""

        for i in range(min(num_workers, len(self.workers))):
            worker = self.workers.pop()
            worker.dismiss()
Tell num_workers worker threads to to quit when they're done.
recipes/Python/435883_Easy_use_objectoriented_thread_pool/recipe-435883.py