close method

void close()

Settles logical work and callbacks synchronously. Does not undo server work.

Implementation

void close() {
  if (_closed) {
    return;
  }
  _closed = true;
  _ObserverFailure? failure;
  for (final execution in _active.toList()) {
    final observerFailure = execution.close();
    failure ??= observerFailure;
  }
  try {
    _ownedClient?.close();
  } catch (e, s) {
    failure ??= _ObserverFailure(e, s);
  }
  if (failure != null) {
    Error.throwWithStackTrace(failure.error, failure.stack);
  }
}