- thenApply 接收一个函数作为参数,
thenApply(Functin<? super T,? extend U> fu>
接收参数A->B 用 thenApply
接收参数A->CompletableFutureB,转换成新的ComplatableFuture. 用thenCompose
处理异常用 exceptionally
thenCombine:
合并2个线程的结果,进一步进行处理.
运行A和B任务,如果有相互依赖关系,用thenCompose,如果没有的话 就用thenCombine提升效率.
thenAccept:
对结果进行护理 v-> v2. 没有返回值,就是值的回调.