forEachIsolateHelper function

Future<void> forEachIsolateHelper(
  1. VmService vmService,
  2. Future<void> callback(
    1. IsolateRef
    )
)

Implementation

Future<void> forEachIsolateHelper(
  VmService vmService,
  Future<void> Function(IsolateRef) callback,
) async {
  final vm = await vmService.getVM();
  final futures = <Future<void>>[];
  for (final isolate in vm.isolates ?? []) {
    futures.add(callback(isolate));
  }
  await Future.wait(futures);
}