WIP: initial prototype

- Added randomizeHost option
- Added ignore status code option
- Updated error classes
- Added ndjson support
- Retry on 502/3/4
This commit is contained in:
delvedor
2018-10-25 17:10:00 +02:00
parent 145e2ab5e5
commit 8ce9f970f0
5 changed files with 69 additions and 15 deletions

View File

@ -52,6 +52,7 @@ class Client extends EventEmitter {
sniffEndpoint: '_nodes/_all/http',
sniffOnConnectionFault: false,
resurrectStrategy: 'ping',
randomizeHost: true,
ssl: null,
agent: null
}, opts)
@ -61,6 +62,7 @@ class Client extends EventEmitter {
this[kConnectionPool] = new options.ConnectionPool({
pingTimeout: opts.pingTimeout,
resurrectStrategy: opts.resurrectStrategy,
randomizeHost: opts.randomizeHost,
selector: this[kSelector],
ssl: options.ssl,
agent: null