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