pmap

suspend fun <A, B> Iterable<A>.pmap(f: suspend (A) -> B): Iterable<B>

Launch a new coroutine for each map iteration using async. From https://jivimberg.io/blog/2018/05/04/parallel-map-in-kotlin/.

Return

the resulting list after apply f to the elements of the iterable

Parameters

A

the type of elements in the iterable

B

the type of elements returned by the function

f

the function to apply to the elements