mapAsyncUnordered

fun <T, R> Flow<T>.mapAsyncUnordered(concurrency: Int, transform: suspend (T) -> R): Flow<R>

Maps values through transform with up to concurrency invocations in flight, emitting results in completion order.

Results are emitted as soon as they are ready, so the output order can differ from the upstream order. The upstream is collected only while permits are available. A failure in transform or the upstream cancels all in-flight work and fails the flow.

Throws