finds.dev

JacksonTian/bagpipe

Async call limit

View on GitHubHomepage ↗

★ 320JavaScriptNOASSERTIONupdated May 2022

// the take

Bagpipe is a Node.js concurrency limiter for callback-style async functions. You give it a max concurrency count, push functions and their arguments into it, and it queues the excess. It predates Promise-based concurrency utilities and was built for the Node.js callback era.

The queue backpressure model is sound — the `full` event gives you an observable signal for when your system is falling behind, which most similar utilities skip. The `refuse` option letting you shed load instead of queuing indefinitely is the right default to expose. The EMFILE file descriptor example in the README is a concrete, real use case that actually illustrates why you'd want this. The implementation is tiny — one file, easy to audit.

This is a dead library. Last meaningful activity was years ago and it only works with the Node.js callback convention (last argument must be a callback). In 2024, everyone is using Promises — p-limit, p-queue, or even a simple semaphore pattern handles this better and works with async/await. The `this` binding caveat called out in Best Practices is a footgun that `bind` only partially fixes. There is no support for prioritization, no way to cancel queued calls, and no Promise-returning API — so adopting it today means either staying in callback-land or wrapping everything in promisify, which is more trouble than just using a modern alternative.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
320
Forks
48
Language
JavaScript
License
NOASSERTION
Last commit
8 May 2022

// nearby

If bagpipe isn't quite it.

All repos →