parallelMapNotNull
suspend fun <T, R : Any> Iterable<T>.parallelMapNotNull(concurrency: Int = Int.MAX_VALUE, transform: suspend (T) -> R?): List<R>
Transforms every element concurrently and returns the non-null results in the original order.
At most concurrency transforms run at the same time, limited by a Semaphore. The first failing transform cancels the remaining work and its failure is rethrown to the caller.
Cancellation: cancelling the calling coroutine cancels every in-flight transform before rethrowing.
Parameters
concurrency
the maximum number of concurrent transforms, at least 1.
Throws
if concurrency is less than 1.