List<Future<>> futures = new ArrayList<>();
List<T> t= new ArrayList<>();
try {
List<> tmp= new ArrayList<....>
for (int i = 0; i < tmp.size(); i++){
futures.add(excutefunc());
}
}catch (Exception e){
logger.error("Error" + e.getMessage());
}
for(Future<CMCBuild> future : futures) {
try {
while (true) {
if (future.isDone() && !future.isCancelled()) {
T response1 = future.get();
t.add(response1);
break;
} else {
Thread.sleep(10);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}

@Async
excutefunc(){
}

相关文章:

  • 2021-10-19
  • 2021-09-25
  • 2021-09-22
  • 2022-01-26
  • 2021-07-27
  • 2021-08-09
  • 2022-03-06
  • 2021-11-02
猜你喜欢
  • 2021-06-03
  • 2022-12-23
  • 2022-01-05
  • 2021-11-22
  • 2021-06-11
  • 2021-04-26
  • 2021-10-17
相关资源
相似解决方案