1.0.2 • Published 2 years ago

backpressure-queue v1.0.2

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
2 years ago

backpressure-queue

Node.js CI

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)
1.0.2

2 years ago

1.0.1

7 years ago

1.0.0

7 years ago