hashcode-utils-kt / org.hildan.hashcode.utils.runner / runInParallel

runInParallel

suspend fun <I> runInParallel(vararg inputs: I, exceptionsLogger: UncaughtExceptionsLogger = UncaughtExceptionsLogger.STDERR, remindExceptionsAtTheEnd: Boolean = true, block: suspend (I) -> Unit): Unit

Runs the given function on each of the given input, each in its own coroutine.

Note: Depending on your choice of UncaughtExceptionsLogger, you may need to provide an SLF4J implementation on your classpath to be able to see error logs.

Parameters

I - the type of input that the block handles

exceptionsLogger - defines what to do with uncaught exceptions thrown by block

block - the block to run on the inputs given to run