mapAsync

suspend fun <T, R> Iterable<T>.mapAsync(transformation: suspend (T) -> R): List<R>

An async replacement for Iterable.map(), which processes all elements in parallel using coroutines. The function preserves the order of the Iterable it is applied on.

Return

A List of transformation results.

Receiver

An iterable of elements to map.

Parameters

T

The input type of the transformation.

R

The output type of the transformation.

transformation

The mapping transformation to apply asynchronously to every element.