dsmiley commented on a change in pull request #1688: URL: https://github.com/apache/lucene-solr/pull/1688#discussion_r463643723
########## File path: solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java ########## @@ -113,6 +118,25 @@ protected boolean wasCommError(Throwable rootCause) { return false; } + /** + * Execute an asynchronous request against a Solr server for a given collection + * + * @param request the request to execute + * @param collection the collection to execute the request against + * @param asyncListener the request listener, not null (use a no-op listener instead for async requests with no callback) + * + * @return a {@link Cancellable} allowing you to cancel execution of the async request + * + * @throws IOException If there is a low-level I/O error. + * @throws SolrServerException if there is an error on the server + */ + public Cancellable asyncRequest(@SuppressWarnings({"rawtypes"}) SolrRequest request, Review comment: To be clear, I am not proposing both (CF & listener), I'm proposing just CF (of NamedList generic type). The CF is versatile enough to allow the client to (1) cancel if desired, (2) to provide a Future; maybe the client prefers a Future (3) to provide a listener for just-in-time action *if* he/she chooses (e.g. via cf.handle(....)). tricky == fun :-). I just spent some time playing around with a CF and the tricky part seems propagating a just-in-time cancel from the client calling cf.cancel() onwards to something else that can do something immediately, thus avoiding a poll. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org