Future<void> completeWith(FutureOr<T> Function() fn) async { try { complete(await fn()); } catch (e) { completeError(e); } }