runToCompletion method

Future<List<WorkerJob>> runToCompletion(
  1. Iterable<DependentJob> jobs
)

Runs all of the jobs to completion, and returns a list of completed jobs when all have been completed.

To listen to jobs as they are completed, use startWorkers instead.

Implementation

Future<List<WorkerJob>> runToCompletion(Iterable<DependentJob> jobs) async {
  final List<WorkerJob> results = <WorkerJob>[];
  await startWorkers(jobs).forEach(results.add);
  return results;
}