OpenSearch/docs/java-rest/low-level
Luca Cavanna cfb186afaf Add support for cancelling async requests in low-level REST client (#45379)
The low-level REST client exposes a `performRequestAsync` method that
allows to send async requests, but today it does not expose the ability
to cancel such requests. That is something that the underlying apache
async http client supports, and it makes sense for us to expose.

This commit adds a return value to the `performRequestAsync` method,
which is backwards compatible. A `Cancellable` object gets returned,
which exposes a `cancel` public method. When calling `cancel`, the
on-going request associated with the returned `Cancellable` instance
will be cancelled by calling its `abort` method. This works throughout
multiple retries, though some special care was needed for the case where
`cancel` is called between different attempts (when one attempt has
failed and the consecutive one has not been sent yet).

Note that cancelling a request on the client side does not automatically 
translate to cancelling the server side execution of it. That needs to be 
specifically implemented, which is on the work for the search API (see #43332).

Relates to #44802
2019-09-12 09:45:28 +02:00
..
configuration.asciidoc Remove support for maxRetryTimeout from low-level REST client (#38085) 2019-02-06 08:43:47 +01:00
index.asciidoc Revert "[Docs] Update Java Low-Level documentation to reflect shaded deps (#25882)" (#26411) 2017-08-29 09:26:36 -05:00
sniffer.asciidoc LLClient: Support host selection (#30523) 2018-06-11 17:07:27 -04:00
usage.asciidoc Add support for cancelling async requests in low-level REST client (#45379) 2019-09-12 09:45:28 +02:00