FixedThreadPool
有什么区别,可以用作风箱:
ExecutorService ex = Executors.newFixedThreadPool();
和CachedThreadPool
:
ExecutorService ex = Executors.newCachedThreadPool();
在CompletableFuture
上:
CompletableFuture<Integer> promise = CompletableFuture.supplyAsync(()->{.........}, ex);