Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 26 days 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T21:44:35.000Z (9 months ago)
- Last Synced: 2024-04-07T22:34:11.135Z (9 months ago)
- Topics: backpressure, parallel, queue, streams
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/backpressure-queue
- Size: 975 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# backpressure-queue
![Node.js CI](https://github.com/r-k-b/backpressure-queue/workflows/Node.js%20CI/badge.svg?branch=master)
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)