feature #I7HJFX 将等待所有future任务的get方法修改为join方法,join方法get方法会抛出经检查的异常,可被捕获
This commit is contained in:
parent
0740499508
commit
d3b0d134f9
|
@ -91,7 +91,7 @@ public abstract class LoopCondition extends Condition {
|
|||
//循环并行执行的futureList处理
|
||||
protected void handleFutureList(List<CompletableFuture<LoopFutureObj>> futureList)throws Exception{
|
||||
CompletableFuture<?> resultCompletableFuture = CompletableFuture.allOf(futureList.toArray(new CompletableFuture[]{}));
|
||||
resultCompletableFuture.join();
|
||||
resultCompletableFuture.get();
|
||||
//获取所有的执行结果,如果有失败的,那么需要抛出异常
|
||||
for (CompletableFuture<LoopFutureObj> future : futureList) {
|
||||
LoopFutureObj loopFutureObj = future.get();
|
||||
|
|
Loading…
Reference in New Issue