异步使用completablefuture.runasync(() -> {})方法调用
问题
CompletableFuture.runAsync() 返回CompletableFuture<Void>对象,调用CompletableFuture.allOf(f1,f2).join() 是否能够阻塞主线程
public static void main(String[] args) {
CompletableFuture<Void> f1 = CompletableFuture.runAsync(() -> {
.
原创
2021-08-19 15:49:22 ·
6924 阅读 ·
0 评论