https://github.com/r-k-b/backpressure-queue
Pipe nodejs streams into an async.queue for parallelisation, get backpressure when the queue is full.
https://github.com/r-k-b/backpressure-queue
backpressure parallel queue streams
Last synced: 4 months ago
JSON representation
Pipe nodejs streams into an async.queue for parallelisation, get backpressure when the queue is full.
- Host: GitHub
- URL: https://github.com/r-k-b/backpressure-queue
- Owner: r-k-b
- License: gpl-3.0
- Created: 2017-09-21T05:12:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-07-13T11:30:01.000Z (4 months ago)
- Last Synced: 2025-07-14T06:14:08.075Z (4 months ago)
- Topics: backpressure, parallel, queue, streams
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/backpressure-queue
- Size: 1.02 MB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# backpressure-queue

Returns a Writable ObjectMode Stream that allows a certain number of
simultaneous promises, and triggers stream backpressure when the
concurrency limit is hit.
Errors are swallowed.
The return value of doWork() is ignored, and cannot be retrieved.
Usage:
async function foo(someItem) {
console.log('work done on ' + someItem)
return
}
const w = writableQueue({doWork: foo, limitConcurrent: 2})
someSourceStream.pipe(w)