acando86
10/11/2018, 5:07 PMconcatMap
of Rx). Is awaitAll
order-preserving on lists? if not, what's the best way to be non-blocking on the map while keeping the order of the list?enleur
10/11/2018, 5:13 PMval results = requests
.map { req -> async { doRequest(req) }}
.awaitAll()
val results = listOf(5,3,2,5,7,1,6)
.map { async { delay(it * 1000L); it } }
.awaitAll()
println(results)
[5, 3, 2, 5, 7, 1, 6]
acando86
10/11/2018, 5:40 PMawaitAll
exactly like that but couldnt find in the documentation whether it was guarantee to be order-preserving or not, and since it's not strictly equivalent to .map {it.await()} i was not that sure about the order. cool , thanksenleur
10/11/2018, 5:42 PMelizarov
10/11/2018, 8:53 PM