close method
Rejects new leases, drains accepted work, and closes the connection.
Implementation
@override
Future<void> close() => _closing ??= _tail.then((_) async {
if (!_discarded && _connection.connected) {
try {
await _connection.close().timeout(_options.queryTimeout);
} catch (_) {
_connection.getSocket().destroy();
rethrow;
}
} else {
_connection.getSocket().destroy();
}
});