0
所以閱讀的ExecutorCompletionService
javadoc的,看起來像它使用具有像invokeAll()
方法的ThreadPoolExecutor,但是,ExecutorCompletionService
只提供submit()方法,因此不讓我們打電話invokeAll
,並在一次如果觸發所有任務任務通過ExecutorCompletionService
提交。ExecutorCompletionService失蹤的invokeAll接口
難道不應該支持invokeAll()
,這樣我可以準備的任務列表,並呼籲像
ExecutorCompletionService.invokeAll(listOfTasks);
,而不是調用
ExecutorCompletionService.submit(task);
在
for循環?
這不是'ExecutorCompletionService'的工作方式。你想做什麼? –