Skip to content

Commit b70a549

Browse files
[Backport 8.10] Add doc for closing connections (#2106)
(cherry picked from commit d3f22f1) Co-authored-by: Josh Mock <[email protected]>
1 parent 5dac169 commit b70a549

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/connecting.asciidoc

+15
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This page contains the information you need to connect and use the Client with
1212
* <<client-connect-proxy, Connecting through a proxy>>
1313
* <<client-error-handling, Handling errors>>
1414
* <<keep-alive, Keep-alive connections>>
15+
* <<close-connections, Closing a client's connections>>
1516
* <<product-check, Automatic product check>>
1617

1718
[[authentication]]
@@ -691,6 +692,20 @@ const client = new Client({
691692
})
692693
----
693694

695+
[discrete]
696+
[[close-connections]]
697+
=== Closing a client's connections
698+
699+
If you would like to close all open connections being managed by an instance of the client, use the `close()` function:
700+
701+
[source,js]
702+
----
703+
const client = new Client({
704+
node: 'http://localhost:9200'
705+
});
706+
client.close();
707+
----
708+
694709
[discrete]
695710
[[product-check]]
696711
=== Automatic product check

0 commit comments

Comments
 (0)