parallelMapIndexed
suspend fun <T, S> Collection<T>.parallelMapIndexed(maxConcurrentRequests: Int? = null, mapper: suspend (index: Int, T) -> S): List<S>
Maps every element of this collection using mapper in parallel.
Parameters
maxConcurrentRequests
the maximum amount of concurrent coroutines (null
means unlimited)
This in itself does not launch multiple threads, how many threads are launched is dependent on the used Dispatcher