{
  "type": "module",
  "source": "doc/api/api-balancedpool.md",
  "modules": [
    {
      "textRaw": "Class: BalancedPool",
      "name": "class:_balancedpool",
      "type": "module",
      "desc": "<p>Extends: <code>undici.Dispatcher</code></p>\n<p>A pool of <a href=\"/docs/docs/api/Pool.html\">Pool</a> instances connected to multiple upstreams.</p>\n<p>Requests are not guaranteed to be dispatched in order of invocation.</p>",
      "signatures": [
        {
          "textRaw": "`new BalancedPool(upstreams [, options])`",
          "name": "BalancedPool",
          "type": "ctor",
          "params": [
            {
              "name": "upstreams "
            },
            {
              "name": "options",
              "optional": true
            }
          ],
          "desc": "<p>Arguments:</p>\n<ul>\n<li><strong>upstreams</strong> <code>URL | string | string[]</code> - It should only include the <strong>protocol, hostname, and port</strong>.</li>\n<li><strong>options</strong> <code>BalancedPoolOptions</code> (optional)</li>\n</ul>",
          "modules": [
            {
              "textRaw": "Parameter: `BalancedPoolOptions`",
              "name": "parameter:_`balancedpooloptions`",
              "type": "module",
              "desc": "<p>Extends: <a href=\"/docs/docs/api/Pool.html#parameter-pooloptions\"><code>PoolOptions</code></a></p>\n<ul>\n<li><strong>factory</strong> <code>(origin: URL, opts: Object) => Dispatcher</code> - Default: <code>(origin, opts) => new Pool(origin, opts)</code></li>\n</ul>\n<p>The <code>PoolOptions</code> are passed to each of the <code>Pool</code> instances being created.</p>",
              "displayName": "Parameter: `BalancedPoolOptions`"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Instance Properties",
          "name": "instance_properties",
          "type": "module",
          "properties": [
            {
              "textRaw": "`BalancedPool.upstreams`",
              "name": "upstreams",
              "type": "property",
              "desc": "<p>Returns an array of upstreams that were previously added.</p>"
            },
            {
              "textRaw": "`BalancedPool.closed`",
              "name": "closed",
              "type": "property",
              "desc": "<p>Implements <a href=\"/docs/docs/api/Client.html#clientclosed\">Client.closed</a></p>"
            },
            {
              "textRaw": "`BalancedPool.destroyed`",
              "name": "destroyed",
              "type": "property",
              "desc": "<p>Implements <a href=\"/docs/docs/api/Client.html#clientdestroyed\">Client.destroyed</a></p>"
            },
            {
              "textRaw": "`BalancedPool.stats`",
              "name": "stats",
              "type": "property",
              "desc": "<p>Returns <a href=\"/docs/docs/api/PoolStats.html\"><code>PoolStats</code></a> instance for this pool.</p>"
            }
          ],
          "displayName": "Instance Properties"
        },
        {
          "textRaw": "Instance Methods",
          "name": "instance_methods",
          "type": "module",
          "methods": [
            {
              "textRaw": "`BalancedPool.addUpstream(upstream)`",
              "name": "addUpstream",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "upstream"
                    }
                  ]
                }
              ],
              "desc": "<p>Add an upstream.</p>\n<p>Arguments:</p>\n<ul>\n<li><strong>upstream</strong> <code>string</code> - It should only include the <strong>protocol, hostname, and port</strong>.</li>\n</ul>"
            },
            {
              "textRaw": "`BalancedPool.removeUpstream(upstream)`",
              "name": "removeUpstream",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "upstream"
                    }
                  ]
                }
              ],
              "desc": "<p>Removes an upstream that was previously added.</p>"
            },
            {
              "textRaw": "`BalancedPool.close([callback])`",
              "name": "close",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "callback",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Implements <a href=\"/docs/docs/api/Dispatcher.html#dispatcherclosecallback-promise\"><code>Dispatcher.close([callback])</code></a>.</p>"
            },
            {
              "textRaw": "`BalancedPool.destroy([error, callback])`",
              "name": "destroy",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "error",
                      "optional": true
                    },
                    {
                      "name": "callback",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Implements <a href=\"/docs/docs/api/Dispatcher.html#dispatcherdestroyerror-callback-promise\"><code>Dispatcher.destroy([error, callback])</code></a>.</p>"
            },
            {
              "textRaw": "`BalancedPool.connect(options[, callback])`",
              "name": "connect",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options"
                    },
                    {
                      "name": "callback",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>See <a href=\"/docs/docs/api/Dispatcher.html#dispatcherconnectoptions-callback\"><code>Dispatcher.connect(options[, callback])</code></a>.</p>"
            },
            {
              "textRaw": "`BalancedPool.dispatch(options, handlers)`",
              "name": "dispatch",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options"
                    },
                    {
                      "name": "handlers"
                    }
                  ]
                }
              ],
              "desc": "<p>Implements <a href=\"/docs/docs/api/Dispatcher.html#dispatcherdispatchoptions-handler\"><code>Dispatcher.dispatch(options, handlers)</code></a>.</p>"
            },
            {
              "textRaw": "`BalancedPool.pipeline(options, handler)`",
              "name": "pipeline",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options"
                    },
                    {
                      "name": "handler"
                    }
                  ]
                }
              ],
              "desc": "<p>See <a href=\"/docs/docs/api/Dispatcher.html#dispatcherpipelineoptions-handler\"><code>Dispatcher.pipeline(options, handler)</code></a>.</p>"
            },
            {
              "textRaw": "`BalancedPool.request(options[, callback])`",
              "name": "request",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options"
                    },
                    {
                      "name": "callback",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>See <a href=\"/docs/docs/api/Dispatcher.html#dispatcherrequestoptions-callback\"><code>Dispatcher.request(options [, callback])</code></a>.</p>"
            },
            {
              "textRaw": "`BalancedPool.stream(options, factory[, callback])`",
              "name": "stream",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options"
                    },
                    {
                      "name": "factory"
                    },
                    {
                      "name": "callback",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>See <a href=\"/docs/docs/api/Dispatcher.html#dispatcherstreamoptions-factory-callback\"><code>Dispatcher.stream(options, factory[, callback])</code></a>.</p>"
            },
            {
              "textRaw": "`BalancedPool.upgrade(options[, callback])`",
              "name": "upgrade",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options"
                    },
                    {
                      "name": "callback",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>See <a href=\"/docs/docs/api/Dispatcher.html#dispatcherupgradeoptions-callback\"><code>Dispatcher.upgrade(options[, callback])</code></a>.</p>"
            }
          ],
          "displayName": "Instance Methods"
        },
        {
          "textRaw": "Instance Events",
          "name": "instance_events",
          "type": "module",
          "events": [
            {
              "textRaw": "Event: `'connect'`",
              "name": "connect",
              "type": "event",
              "params": [],
              "desc": "<p>See <a href=\"/docs/docs/api/Dispatcher.html#event-connect\">Dispatcher Event: <code>'connect'</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'disconnect'`",
              "name": "disconnect",
              "type": "event",
              "params": [],
              "desc": "<p>See <a href=\"/docs/docs/api/Dispatcher.html#event-disconnect\">Dispatcher Event: <code>'disconnect'</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'drain'`",
              "name": "drain",
              "type": "event",
              "params": [],
              "desc": "<p>See <a href=\"/docs/docs/api/Dispatcher.html#event-drain\">Dispatcher Event: <code>'drain'</code></a>.</p>"
            }
          ],
          "displayName": "Instance Events"
        }
      ],
      "displayName": "Class: BalancedPool"
    }
  ]
}