From d3f22f1e14d292849d55eaea356d6f28ea7abfec Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Thu, 14 Dec 2023 09:46:04 -0600 Subject: [PATCH] Add doc for closing connections (#2104) --- docs/connecting.asciidoc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/connecting.asciidoc b/docs/connecting.asciidoc index 77c2e7d11..15007ceb3 100644 --- a/docs/connecting.asciidoc +++ b/docs/connecting.asciidoc @@ -12,6 +12,7 @@ This page contains the information you need to connect and use the Client with * <> * <> * <> +* <> * <> [[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