Mark Allanson
06/10/2021, 3:38 PMCasey Brooks
06/10/2021, 3:50 PMasync
, and await
all those after they’ve all been launched:
val responses = listOf<Request>()
.map { async { it.exec() } } // launch each HTTP request in parallel
.map { it.await() } // wait for the responses to come in
Mark Allanson
06/10/2021, 3:50 PMCasey Brooks
06/10/2021, 3:52 PMMark Allanson
06/10/2021, 4:15 PM