Skip to content

Commit ec8a056

Browse files
committed
add comments to CompletableFutures utility.
1 parent c0f2c9b commit ec8a056

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

contrib/temporal-payload-storage-s3/src/main/java/io/temporal/payload/storage/s3/CompletableFutures.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
final class CompletableFutures {
88
private CompletableFutures() {}
99

10+
/**
11+
* Returns a future that completes when all of the given futures complete, yielding a list of
12+
* their results. If any future completes exceptionally, the returned future also completes
13+
* exceptionally with the same exception. If the input list is empty, the returned future completes
14+
* immediately with an empty list.
15+
*
16+
* @param <T>
17+
* @param futures
18+
* @return
19+
*/
1020
static <T> CompletableFuture<List<T>> allOf(List<CompletableFuture<T>> futures) {
1121
return CompletableFuture.allOf(futures.toArray(new CompletableFuture<?>[0]))
1222
.thenApply(

0 commit comments

Comments
 (0)