startManagedProcesses<T> function
Starts every prepared worker and waits for all of them, even when one start callback throws synchronously or one worker fails immediately.
The callbacks are invoked before awaiting any result so a single launch error cannot leave later workers unstarted and outside the caller's join.
Implementation
Future<List<T>> startManagedProcesses<T>(
Iterable<Future<T> Function()> start,
) {
final running = <Future<T>>[];
for (final startProcess in start) {
running.add(Future<T>.sync(startProcess));
}
return Future.wait(running, eagerError: false);
}