stopAll method

  1. @override
Future<void> stopAll({
  1. bool shouldIncludeStarting = true,
})
inherited

Implementation

@override
Future<void> stopAll({bool shouldIncludeStarting = true}) async {
  final running = satellites.keys.map((dbName) => stop(dbName)).toList();
  final stopping = stoppingPromises.values.toList();

  var promisesToStop = <Future<dynamic>>[...running, ...stopping];
  if (shouldIncludeStarting) {
    final starting = startingPromises.entries.map((entry) {
      final dbName = entry.key;
      final started = entry.value;
      return started.then((_) => stop(dbName));
    }).toList();
    promisesToStop = [...promisesToStop, ...starting];
  }

  await Future.wait<void>(promisesToStop);
}