xwt
2025-07-17 66f29ab451014ca2e72fa9a5ff6373ab507ff67c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Pool from './pool'
import Dispatcher from './dispatcher'
import { URL } from 'url'
 
export default BalancedPool
 
type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
 
declare class BalancedPool extends Dispatcher {
  constructor(url: string | string[] | URL | URL[], options?: Pool.Options);
 
  addUpstream(upstream: string | URL): BalancedPool;
  removeUpstream(upstream: string | URL): BalancedPool;
  upstreams: Array<string>;
 
  /** `true` after `pool.close()` has been called. */
  closed: boolean;
  /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
  destroyed: boolean;
 
  // Override dispatcher APIs.
  override connect(
    options: BalancedPoolConnectOptions
  ): Promise<Dispatcher.ConnectData>;
  override connect(
    options: BalancedPoolConnectOptions,
    callback: (err: Error | null, data: Dispatcher.ConnectData) => void
  ): void;
}