settled method

Future<bool> settled(
  1. Duration within
)

Waits within for the running tasks without closing the registry.

Implementation

Future<bool> settled(Duration within) async {
  if (_running.isEmpty) return true;

  final idle = _idle ??= Completer<void>();
  try {
    await idle.future.timeout(within);
    return true;
  } on TimeoutException {
    return false;
  }
}