close method
Implementation
Future<void> close() async {
if (!_isClosing) {
final result = _submitWorkFunction((tx) async {
tx.closeAfterwards = true;
}, 'close');
_isClosing = true;
_startWorkingIfNeeded(isImplicit: false);
return result;
} else if (_pendingWork.isNotEmpty) {
// Already closing, await all pending operations then.
final op = _pendingWork.last;
return op.completer.future;
}
}