ExecutorService.submit(Task) vs CompletableFuture.supplyAsync(Task, Executor)

后端 未结 3 1185
盖世英雄少女心
盖世英雄少女心 2021-01-30 16:39

To run some stuff in parallel or asynchronously I can use either an ExecutorService: Future submit(Runnable task, T result); or the CompletableFu

3条回答
  •  一个人的身影
    2021-01-30 17:13

    This clarified for me the difference between future an completable future a bit more: Difference between Future and Promise

    CompletableFuture is more like a promise.

提交回复
热议问题