[Backport 8.10] Add doc for closing connections (#2106)

(cherry picked from commit d3f22f1e14)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
github-actions[bot]
2023-12-14 09:47:29 -06:00
committed by GitHub
parent 5dac169311
commit b70a54971c

View File

@ -12,6 +12,7 @@ This page contains the information you need to connect and use the Client with
* <<client-connect-proxy, Connecting through a proxy>>
* <<client-error-handling, Handling errors>>
* <<keep-alive, Keep-alive connections>>
* <<close-connections, Closing a client's connections>>
* <<product-check, Automatic product check>>
[[authentication]]
@ -691,6 +692,20 @@ const client = new Client({
})
----
[discrete]
[[close-connections]]
=== Closing a client's connections
If you would like to close all open connections being managed by an instance of the client, use the `close()` function:
[source,js]
----
const client = new Client({
node: 'http://localhost:9200'
});
client.close();
----
[discrete]
[[product-check]]
=== Automatic product check