Extends: undici.Dispatcher
A pool of Pool instances connected to multiple upstreams.
Requests are not guaranteed to be dispatched in order of invocation.
new BalancedPool(upstreams , options?): voidArguments:
- 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.
Returns an array of upstreams that were previously added.
Implements Client.closed
Implements Client.destroyed
Returns PoolStats instance for this pool.
BalancedPool.addUpstream(upstream): voidAdd an upstream.
Arguments:
- upstream
string- It should only include the protocol, hostname, and port.
BalancedPool.removeUpstream(upstream): voidRemoves an upstream that was previously added.
BalancedPool.close(callback?): voidImplements Dispatcher.close([callback]).
BalancedPool.destroy(error?, callback?): voidImplements Dispatcher.destroy([error, callback]).
BalancedPool.connect(options, callback?): voidSee Dispatcher.connect(options[, callback]).
BalancedPool.dispatch(options, handlers): voidImplements Dispatcher.dispatch(options, handlers).
BalancedPool.pipeline(options, handler): voidSee Dispatcher.pipeline(options, handler).
BalancedPool.request(options, callback?): voidSee Dispatcher.request(options [, callback]).
BalancedPool.stream(options, factory, callback?): voidSee Dispatcher.stream(options, factory[, callback]).
BalancedPool.upgrade(options, callback?): voidSee Dispatcher.upgrade(options[, callback]).
See Dispatcher Event: 'connect'.