mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Add a few notes on Cancellable to the LLRC and HLRC docs. (#45912)
Add a section to both the low level and high level client documentation on asynchronous usage and `Cancellable` added for #44802 Co-Authored-By: Lee Hinman <dakrone@users.noreply.github.com>
This commit is contained in:
parent
9c6d9a9049
commit
e40be722cc
2 changed files with 26 additions and 0 deletions
|
@ -338,6 +338,12 @@ the underlying http client. On the server side, this does not automatically
|
|||
translate to the execution of that request being cancelled, which needs to be
|
||||
specifically implemented in the API itself.
|
||||
|
||||
The use of the `Cancellable` instance is optional and you can safely ignore this
|
||||
if you don't need it. A typical usecase for this would be using this together with
|
||||
frameworks like Rx Java or the Kotlin's `suspendCancellableCoRoutine`. Cancelling
|
||||
no longer needed requests is a good way to avoid putting unnecessary
|
||||
load on Elasticsearch.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/RestClientDocumentation.java[rest-client-async-cancel]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue