Extends: undici.Dispatcher
A pool of Pool instances connected to multiple upstreams.
Requests are not guaranteed to be dispatched in order of invocation.
Arguments:
- upstreams
URL | string | string[]- It should only include the protocol, hostname, and port. - options
BalancedPoolOptions(optional)
Extends: PoolOptions
- factory
(origin: URL, opts: Object) => Dispatcher- Default:(origin, opts) => new Pool(origin, opts)
The PoolOptions are passed to each of the Pool instances being created.
When an upstream hostname resolves to multiple DNS records, BalancedPool
resolves the hostname lazily at connect time and rotates new connections across
the resolved addresses. Requests continue to use the original hostname for
Host headers and TLS servername.
Returns an array of upstreams that were previously added.
Implements Client.closed
Implements Client.destroyed
Returns PoolStats instance for this pool.
Add an upstream.
Arguments:
- upstream
string- It should only include the protocol, hostname, and port.
Removes an upstream that was previously added.
Implements Dispatcher.close([callback]).
Implements Dispatcher.destroy([error, callback]).
See Dispatcher.connect(options[, callback]).
Implements Dispatcher.dispatch(options, handlers).
See Dispatcher.pipeline(options, handler).
See Dispatcher.request(options [, callback]).
See Dispatcher.stream(options, factory[, callback]).
See Dispatcher.upgrade(options[, callback]).
See Dispatcher Event: 'connect'.