poohbar
08/03/2018, 6:25 PMCompletableFuture<List<Person>>
from
List<CompletableFuture<Person>>
I can't wrap my head around it 😕Ruckus
08/03/2018, 6:37 PMfun <T> List<CompletableFuture<T>>.unwrap(): CompletableFuture<List<T>> =
CompletableFuture.allOf(*toTypedArray()).thenApply { map { it.join() } }
CompletableFuture
that waits for all the others to finish, then unwraps each value into a list.poohbar
08/03/2018, 6:53 PMdiesieben07
08/03/2018, 7:22 PMkarelpeeters
08/03/2018, 7:23 PMCan Orhan
08/06/2018, 7:08 AM