hashcode-utils-kt / org.hildan.hashcode.utils / solveHCFilesInParallel

solveHCFilesInParallel

suspend fun solveHCFilesInParallel(vararg filenames: String, exceptionsLogger: UncaughtExceptionsLogger = UncaughtExceptionsLogger.STDERR, remindExceptionsAtTheEnd: Boolean = true, readAndSolve: suspend HCReader.() -> Iterable<CharSequence>): Unit

Solves the problems defined by each of the given input files, each in its own coroutine.

Parameters

filenames - the paths to the input files to read

exceptionsLogger - the way to log uncaught exceptions (defaults to standard error stream)

remindExceptionsAtTheEnd - whether to remind all exceptions that occurred during the runs when all coroutines are done (true by default to ease debugging when the output is too big)

readAndSolve - a function to read the input and solve the problem, returning the output lines to write