【发布时间】:2021-01-12 14:17:04
【问题描述】:
我正在研究 CompletableFuture API,有一个例子:
CompletableFuture.completedFuture(url)
.thenComposeAsync(this::readPage, executor)
.thenApply(this::getImageURLs)
.thenApply(this::saveFoundImages)
.....
我有一个问题:如果我调用thenComposeAsync(...)作为第一个方法,链中的其他方法是否会在我通过参数传递的executor中执行,或者我应该使用async 在特定的执行器中获得异步执行?
【问题讨论】:
标签: java multithreading asynchronous concurrency completable-future