How to use queue with concurrent future ThreadPoolExecutor in python 3?
问题 I am using simple threading modules to do concurrent jobs. Now I would like to take advantages of concurrent futures modules. Can some put me a example of using a queue with concurrent library? I am getting TypeError: 'Queue' object is not iterable I dont know how to iterate queues code snippet: def run(item): self.__log.info(str(item)) return True <queue filled here> with concurrent.futures.ThreadPoolExecutor(max_workers = 100) as executor: furtureIteams = { executor.submit(run, item): item