def __init__(self, max_threads=3):
# priority queue picks things with a lesser value first
self._submission_queue = queue.PriorityQueue()
self._submission_set = set()
self._threads_semaphore = threading.BoundedSemaphore(max_threads)
self._thread = threading.Thread(None, self.__run, 'ExecutorQueue.__run')
self._thread.daemon = True
self._thread.start()
评论列表
文章目录