settle method

Future<void> settle()

Completes when the system has gone quiet: no actor has a message it can handle and no timer is due at the current virtual time. Timers set for later do not count, and time does not advance.

This replaces the short sleeps tests use to "let the actors finish".

Implementation

Future<void> settle() {
  final done = Completer<void>();
  _settling.add(done);
  return done.future;
}