两个CompletionStage,任何一个完成了都会执行下一步的操作(Runnable)
runAfterEither();
两个异步线程 哪个执行的快 选择哪个(查两个库的表)
applyToEither();
thenCombine 将两个异步合在一起处理
thenCombine();
对结果处理,和thenApply类似
handle();
当一个线程依赖另一个线程时,可以使用 thenApply 方法来把这两个线程串行化。
thenApply();
异步结束判断异常
whenComplete();
无返回值
runAsync();
有返回值
supplyAsync();
网友评论