Extends: undici.Dispatcher
A pool of Client instances connected to the same upstream target.
Requests are not guaranteed to be dispatched in order of invocation.
new Pool(url[, options])
Arguments:
URL | string
- It should only include the protocol, hostname, and port.PoolOptions
(optional)PoolOptions
Extends: ClientOptions
(origin: URL, opts: Object) => Dispatcher
- Default: (origin, opts) => new Client(origin, opts)
number | null
(optional) - Default: null
- The number of Client
instances to create. When set to null
, the Pool
instance will create an unlimited amount of Client
instances.{ Pool: DispatchInterceptor[] } }
- Default: { Pool: [] }
- A list of interceptors that are applied to the dispatch method. Additional logic can be applied (such as, but not limited to: 302 status code handling, authentication, cookies, compression and caching).Pool.closed
Implements Client.closed
Pool.destroyed
Implements Client.destroyed
Pool.stats
Returns PoolStats
instance for this pool.
Pool.close([callback])
Implements Dispatcher.close([callback])
.
Pool.destroy([error, callback])
Implements Dispatcher.destroy([error, callback])
.
Pool.connect(options[, callback])
See Dispatcher.connect(options[, callback])
.
Pool.dispatch(options, handler)
Implements Dispatcher.dispatch(options, handler)
.
Pool.pipeline(options, handler)
See Dispatcher.pipeline(options, handler)
.
Pool.request(options[, callback])
See Dispatcher.request(options [, callback])
.
Pool.stream(options, factory[, callback])
See Dispatcher.stream(options, factory[, callback])
.
Pool.upgrade(options[, callback])
See Dispatcher.upgrade(options[, callback])
.
'connect'
See Dispatcher Event: 'connect'
.
'disconnect'
See Dispatcher Event: 'disconnect'
.
'drain'