nerses
10/01/2018, 5:04 PMsuspend fun loadAndCombine(name1: String, name2: String): Image =
coroutineScope {
val deferred1 = async { loadImage(name1) }
val deferred2 = async { loadImage(name2) }
combineImages(deferred1.await(), deferred2.await())
}
and lets say i want to invoke 1000 of these concurrently. Is wrapping these in launch {} block, e.g. repeat (1000) {launch { loadAndCombine() }} the correct way of doing that?