# bunqueue v2.4.0

Auto-batching for queue.add() over TCP, 306 new tests.

Canonical: https://bunqueue.dev/blog/bunqueue-v2-4-0/

---

<!-- Generated from changelog.md by docs/scripts/generate-release-posts.ts. Edit the changelog and regenerate. -->

Auto-batching for queue.add() over TCP, 306 new tests.

![](https://github.com/egeominotti.png?size=64) [egeominotti](https://github.com/egeominotti)

#### To install bunqueue v2.4.0

```bash title="bun"
bun add bunqueue@2.4.0
```

```bash title="npm"
npm install bunqueue@2.4.0
```

#### To upgrade bunqueue

```bash
bun add bunqueue@latest
```

## Auto-batching for `queue.add()` over TCP

Transparently batches concurrent `add()` calls into `PUSHB` commands
- Zero overhead for sequential `await` usage (flush immediately when idle)
- ~3x speedup for concurrent adds (buffers during in-flight flush)
- Configurable: `autoBatch: { maxSize: 50, maxDelayMs: 5 }` (defaults)
- Durable jobs bypass the batcher (sent as individual PUSH)
- Disable with `autoBatch: { enabled: false }`

## 306 new tests

Covering previously untested modules

## Thanks to 1 contributor!

- [@egeominotti](https://github.com/egeominotti)

---

[← bunqueue v2.3.1](https://bunqueue.dev/blog/bunqueue-v2-3-1/) · [Release on GitHub](https://github.com/egeominotti/bunqueue/releases/tag/v2.4.0) · [Commits since v2.3.1](https://github.com/egeominotti/bunqueue/compare/v2.3.1...v2.4.0) · [Full changelog](https://bunqueue.dev/changelog/) · [All posts](https://bunqueue.dev/blog/)
