dispose method
Cancels the loop and awaits owned connection cleanup, once.
Implementation
Future<void> dispose() => _disposing ??= Future<void>.sync(() async {
_lifetime.cancel();
final running = _running;
if (running != null) {
await running;
return;
}
await _messages.close();
});