onClose method

  1. @override
Future<void> onClose()
override

After close there are no new entries, so waits for the whole queue to be written. Does not close store: the app owns it.

Implementation

@override
Future<void> onClose() async {
  _startDraining();
  if (_draining case final draining?) await draining;
}