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: 2 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 (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-04-26T00:21:13.000Z (2 months ago)
- Last Synced: 2025-04-26T01:27:13.343Z (2 months ago)
- Topics: backpressure, parallel, queue, streams
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/backpressure-queue
- Size: 1010 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)