This commit is contained in:
wuweifeng10 2019-12-27 17:02:58 +08:00
parent 73db76404c
commit 925e434d78

View File

@ -33,7 +33,7 @@ public class Async {
CompletableFuture[] futures = new CompletableFuture[workerWrappers.size()];
for (int i = 0; i < workerWrappers.size(); i++) {
WorkerWrapper wrapper = workerWrappers.get(i);
futures[i] = CompletableFuture.runAsync(() -> wrapper.work(COMMON_POOL, timeout), pool);
futures[i] = CompletableFuture.runAsync(() -> wrapper.work(pool, timeout), pool);
}
try {
CompletableFuture.allOf(futures).get(timeout, TimeUnit.MILLISECONDS);