Method submit extends base method Executor.execute(java.lang.Runnable) by creating and returning a Future that
can be used to cancel execution and/or wait for completion.
Methods invokeAny and invokeAll perform the most
commonly useful forms of bulk execution, executing a collection of
tasks and then waiting for at least one, or all, to
complete. (Class ExecutorCompletionService can be used to
write customized variants of these methods.)
ExecutorService submit VS invoke
最新推荐文章于 2024-04-04 16:32:58 发布