bb0200b8f3e36f7a95bc4d4616064c3fea980a158e6e02efb7e0d2aa4e759e4c8f08e0704b080e2bd7235fa95113d3bb8f958349af191f64b59af0256a883e 961 B

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