{
  "type": "module",
  "source": "doc/api/api-pool.md",
  "modules": [
    {
      "textRaw": "Class: Pool",
      "name": "class:_pool",
      "type": "module",
      "desc": "<p>Extends: <code>undici.Dispatcher</code></p>\n<p>A pool of <a href=\"/docs/docs/api/Client.html\">Client</a> instances connected to the same upstream target.</p>\n<p>Requests are not guaranteed to be dispatched in order of invocation.</p>",
      "signatures": [
        {
          "textRaw": "`new Pool(url[, options])`",
          "name": "Pool",
          "type": "ctor",
          "params": [
            {
              "name": "url"
            },
            {
              "name": "options",
              "optional": true
            }
          ],
          "desc": "<p>Arguments:</p>\n<ul>\n<li><strong>url</strong> <code>URL | string</code> - It should only include the <strong>protocol, hostname, and port</strong>.</li>\n<li><strong>options</strong> <code>PoolOptions</code> (optional)</li>\n</ul>",
          "modules": [
            {
              "textRaw": "Parameter: `PoolOptions`",
              "name": "parameter:_`pooloptions`",
              "type": "module",
              "desc": "<p>Extends: <a href=\"/docs/docs/api/Client.html#parameter-clientoptions\"><code>ClientOptions</code></a></p>\n<ul>\n<li><strong>factory</strong> <code>(origin: URL, opts: Object) => Dispatcher</code> - Default: <code>(origin, opts) => new Client(origin, opts)</code></li>\n<li><strong>connections</strong> <code>number | null</code> (optional) - Default: <code>null</code> - The number of <code>Client</code> instances to create. When set to <code>null</code>, the <code>Pool</code> instance will create an unlimited amount of <code>Client</code> instances.</li>\n<li><strong>clientTtl</strong> <code>number | null</code> (optional) - Default: <code>null</code> - The amount of time before a <code>Client</code> instance is removed from the <code>Pool</code> and closed.   When set to <code>null</code>, <code>Client</code> instances will not be removed or closed based on age.</li>\n</ul>\n<blockquote>\n<p>[!NOTE]\n<code>Pool</code> inherits all <a href=\"/docs/docs/api/Client.html#parameter-clientoptions\"><code>ClientOptions</code></a>, including <code>allowH2</code> (default <code>true</code>) and <code>maxConcurrentStreams</code> (default <code>100</code>). With the unlimited default of <code>connections</code>, <code>Pool</code> will open a new <code>Client</code> — and therefore a new TCP/TLS socket — per concurrent dispatch, which defeats HTTP/2 multiplexing on a shared session. To benefit from h2 multiplexing on a single session, cap <code>connections</code> (e.g. <code>connections: 1</code>) so that concurrent requests share a session up to <code>maxConcurrentStreams</code>.</p>\n</blockquote>",
              "displayName": "Parameter: `PoolOptions`"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Instance Properties",
          "name": "instance_properties",
          "type": "module",
          "properties": [
            {
              "textRaw": "`Pool.closed`",
              "name": "closed",
              "type": "property",
              "desc": "<p>Implements <a href=\"/docs/docs/api/Client.html#clientclosed\">Client.closed</a></p>"
            },
            {
              "textRaw": "`Pool.destroyed`",
              "name": "destroyed",
              "type": "property",
              "desc": "<p>Implements <a href=\"/docs/docs/api/Client.html#clientdestroyed\">Client.destroyed</a></p>"
            },
            {
              "textRaw": "`Pool.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": "`Pool.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": "`Pool.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": "`Pool.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": "`Pool.dispatch(options, handler)`",
              "name": "dispatch",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options"
                    },
                    {
                      "name": "handler"
                    }
                  ]
                }
              ],
              "desc": "<p>Implements <a href=\"/docs/docs/api/Dispatcher.html#dispatcherdispatchoptions-handler\"><code>Dispatcher.dispatch(options, handler)</code></a>.</p>"
            },
            {
              "textRaw": "`Pool.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": "`Pool.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": "`Pool.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": "`Pool.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: Pool"
    }
  ]
}