invokeAll

suspend fun <T> invokeAll(callables: MutableCollection<Callable<T>>): MutableList<T>

Execute all the callables provided as an argument, wait for them to complete and return the obtained results. If an exception is thrown by more than one callable, the subsequent ones will be added as suppressed exceptions to the first one that was caught. Additionally, if one task throws an exception, all other tasks from the same group are cancelled, to avoid needless computation as their results would not be exposed anyways.

Return

a list containing the results from the tasks execution

Parameters

callables

the callables to execute

the return type of the task execution