backpressure-queue
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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)

/backpressure-queue/

    Package Sidebar

    Install

    npm i backpressure-queue

    Weekly Downloads

    12

    Version

    1.0.2

    License

    GPL-3.0

    Unpacked Size

    87.4 kB

    Total Files

    22

    Last publish

    Collaborators

    • rkb