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])Arguments:
URL | string | string[] - It should only include the protocol, hostname, and port.BalancedPoolOptions (optional)BalancedPoolOptionsExtends: PoolOptions
(origin: URL, opts: Object) => Dispatcher - Default: (origin, opts) => new Pool(origin, opts)The PoolOptions are passed to each of the Pool instances being created.
BalancedPool.upstreamsReturns an array of upstreams that were previously added.
BalancedPool.closedImplements Client.closed
BalancedPool.destroyedImplements Client.destroyed
Pool.statsReturns PoolStats instance for this pool.
BalancedPool.addUpstream(upstream)Add an upstream.
Arguments:
string - It should only include the protocol, hostname, and port.BalancedPool.removeUpstream(upstream)Removes an upstream that was previously addded.
BalancedPool.close([callback])Implements Dispatcher.close([callback]).
BalancedPool.destroy([error, callback])Implements Dispatcher.destroy([error, callback]).
BalancedPool.connect(options[, callback])See Dispatcher.connect(options[, callback]).
BalancedPool.dispatch(options, handlers)Implements Dispatcher.dispatch(options, handlers).
BalancedPool.pipeline(options, handler)See Dispatcher.pipeline(options, handler).
BalancedPool.request(options[, callback])See Dispatcher.request(options [, callback]).
BalancedPool.stream(options, factory[, callback])See Dispatcher.stream(options, factory[, callback]).
BalancedPool.upgrade(options[, callback])See Dispatcher.upgrade(options[, callback]).
'connect'See Dispatcher Event: 'connect'.
'disconnect'See Dispatcher Event: 'disconnect'.
'drain'