Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
node-version: [22.x, 24.x, 26.x]
Comment thread
glynnbird marked this conversation as resolved.
Resolved

steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ const db = couch.use('foo');

### Pool size and open sockets

To specify the number of connections, timeouts and pool size, supply an `agentOptions` object when starting up Nano.
To specify the number of connections, timeouts and pool size, supply an undici `Agent` as `agentOptions` when starting up Nano. Nano passes `agentOptions` to _fetch_ as its `dispatcher`, so it must be a dispatcher instance, not a plain object of options.

```js
const agentOptions = {
const opts = {
bodyTimeout: 30000,
headersTimeout: 30000,
keepAliveMaxTimeout: 600000,
Expand All @@ -229,19 +229,11 @@ const agentOptions = {
connections: null,
maxRedirections: 0
}
const undici = require('undici')
const undiciOptions = new undici.Agent(agentOptions)
const nano = Nano({ url: 'http://127.0.0.1:5984', undiciOptions })
const { Agent, Dispatcher1Wrapper } = require('undici')
const nano = Nano({ url: 'http://127.0.0.1:5984', agentOptions: new Dispatcher1Wrapper(new Agent(opts)) })
```

The meanings of the agentOptions attributes is described [here](https://undici.nodejs.org/#/docs/api/Agent?id=new-undiciagentoptions), [here](https://undici.nodejs.org/#/docs/api/Pool?id=parameter-pooloptions) and [here](https://undici.nodejs.org/#/docs/api/Client?id=parameter-clientoptions)

You may also supply a pre-existing `undici.Agent` e.g.

```js
const agent = new undici.Agent({bodyTimeout: 30000 })
const nano = Nano({ url: 'http://127.0.0.1:5984', agentOptions: agent })
```
The meanings of the `opts` attributes is described [here](https://undici.nodejs.org/#/docs/api/Agent?id=new-undiciagentoptions), [here](https://undici.nodejs.org/#/docs/api/Pool?id=parameter-pooloptions) and [here](https://undici.nodejs.org/#/docs/api/Client?id=parameter-clientoptions)

> Note `requestDefaults` is no longer supported.

Expand Down
Loading
Loading