@Test(timeOut = 3000L) public void testWaitAsync() throws Exception { new ParallelJobsFuture(successJobFutures(3)) .waitAsync() .join(); }
@Override public CompletableFuture<Void> waitAsync() { Stream<CompletableFuture> futures = jobs .map(JobFuture::waitAsync) .map(curFuture -> curFuture.exceptionally(this::collectErrors)); return CompletableFuture .allOf(array(futures)) .thenApply(this::throwSummaryExceptionIfNeeded); }
ParallelJobsFuture implements JobFuture { @Override public CompletableFuture<Void> waitAsync() { Stream<CompletableFuture> futures = jobs .map(JobFuture::waitAsync) .map(curFuture -> curFuture.exceptionally(this::collectErrors)); return CompletableFuture .allOf(array(futures)) .thenApply(this::throwSummaryExceptionIfNeeded); } }
ParallelJobsFuture implements JobFuture { @Override public CompletableFuture<Void> waitAsync() { Stream<CompletableFuture> futures = jobs .map(JobFuture::waitAsync) .map(curFuture -> curFuture.exceptionally(this::collectErrors)); return CompletableFuture .allOf(array(futures)) .thenApply(this::throwSummaryExceptionIfNeeded); } ParallelJobsFuture(JobFuture... jobs);  ParallelJobsFuture(List<JobFuture> jobs);  ParallelJobsFuture(List<JobInfo> jobInfoList, QueueClient queueClient); }
ParallelJobsFuture implements JobFuture { @Override public CompletableFuture<Void> waitAsync() { Stream<CompletableFuture> futures = jobs .map(JobFuture::waitAsync) .map(curFuture -> curFuture.exceptionally(this::collectErrors)); return CompletableFuture .allOf(array(futures)) .thenApply(this::throwSummaryExceptionIfNeeded); } ParallelJobsFuture(JobFuture... jobs);  ParallelJobsFuture(List<JobFuture> jobs);  ParallelJobsFuture(List<JobInfo> jobInfoList, QueueClient queueClient); @Override void waitUntilComplete(); @Override void waitUntilComplete(Duration timeout); @Override CompletableFuture<Void> waitAsync(); }
ParallelJobsFuture implements JobFuture { @Override public CompletableFuture<Void> waitAsync() { Stream<CompletableFuture> futures = jobs .map(JobFuture::waitAsync) .map(curFuture -> curFuture.exceptionally(this::collectErrors)); return CompletableFuture .allOf(array(futures)) .thenApply(this::throwSummaryExceptionIfNeeded); } ParallelJobsFuture(JobFuture... jobs);  ParallelJobsFuture(List<JobFuture> jobs);  ParallelJobsFuture(List<JobInfo> jobInfoList, QueueClient queueClient); @Override void waitUntilComplete(); @Override void waitUntilComplete(Duration timeout); @Override CompletableFuture<Void> waitAsync();  }