spotify / completable-futures

Utilities for working with futures in Java 8
Apache License 2.0
393 stars 51 forks source link

how to join multiple list #77

Open JasonHuangHuster opened 4 years ago

JasonHuangHuster commented 4 years ago

CompletableFutures.successfulAsList(completableFutures, f -> null) .thenRunAsync(flexExchangeTaskCFuture, CommonExecutorConfiguration.HOME_PAGE_EXECUTOR) .thenRunAsync(backpopRunnable, CommonExecutorConfiguration.HOME_PAGE_EXECUTOR) .thenRunAsync(noActiveSerialRunnable, CommonExecutorConfiguration.HOME_PAGE_EXECUTOR) .get(400, TimeUnit.MILLISECONDS);

as you can see , i have a list of completableFuture that can run in parallel , and three sub task must run after the list , but the three sub task could run in parallel . so can i join multiple list ? like :

CompletableFutures.successfulAsList(listA, f -> null).successfulAsList(listB, f -> null).get(400, TimeUnit.MILLISECONDS);

btw , this lib is really awesome ! tks for your hard work :D