Add doc for closing connections (#2104)
This commit is contained in:
@ -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-connect-proxy, Connecting through a proxy>>
|
||||||
* <<client-error-handling, Handling errors>>
|
* <<client-error-handling, Handling errors>>
|
||||||
* <<keep-alive, Keep-alive connections>>
|
* <<keep-alive, Keep-alive connections>>
|
||||||
|
* <<close-connections, Closing a client's connections>>
|
||||||
* <<product-check, Automatic product check>>
|
* <<product-check, Automatic product check>>
|
||||||
|
|
||||||
[[authentication]]
|
[[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]
|
[discrete]
|
||||||
[[product-check]]
|
[[product-check]]
|
||||||
=== Automatic product check
|
=== Automatic product check
|
||||||
|
|||||||
Reference in New Issue
Block a user