Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
908 views
in Technique[技术] by (71.8m points)

CompletableFuture 中 thenApplyAsync 和 thenComposeAsync的区别

RT,最好可以有代码,感谢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

返回泛型不同,一个没有规定泛型为U,由completableFuture 包装为CompletableFuture<U> ,一个泛型是CompletableFuture<U>,完全由用户自己定义,说白了就是相当于开放了部分权限,thenComposeAsyncthenApplyAsync 更加灵活


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...