LOGGER.debug(logIdent(ctx, endpoint) + "Cancelling " + sentRequestQueue.size() + " outstanding requests.");
while(!sentRequestQueue.isEmpty()) {
REQUEST req = sentRequestQueue.poll();
try {
req.observable().onError(new RequestCancelledException("Request cancelled in-flight."));
} catch (Exception ex) {
LOGGER.info("Exception thrown while cancelling outstanding operation: " + req, ex);
}
}
}