pull-read-queue

1.0.3 • Public • Published

pull-read-queue

treat a pull-stream as a queue.

example

//min: start reading again if we have less than `min` items in the queue.
//max: stop reading when have `max` or more items in the queue.
var queue = ReadQueue(min=5, max = 10, onData)

pull(
  source,
  queue
)

function onData(data) {
  if(output.length < 20)
    output.push(queue.shift()) //etc!
}

License

MIT

/pull-read-queue/

    Package Sidebar

    Install

    npm i pull-read-queue

    Weekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Last publish

    Collaborators

    • dominictarr