solorice/vscode/extensions/geequlim.godot-tools-1.2.0/node_modules/pause-stream
2022-04-28 20:54:44 +03:00
..
test Added vscode settings 2022-04-28 20:54:44 +03:00
.npmignore Added vscode settings 2022-04-28 20:54:44 +03:00
index.js Added vscode settings 2022-04-28 20:54:44 +03:00
LICENSE Added vscode settings 2022-04-28 20:54:44 +03:00
package.json Added vscode settings 2022-04-28 20:54:44 +03:00
readme.markdown Added vscode settings 2022-04-28 20:54:44 +03:00

PauseStream

This is a Stream that will strictly buffer when paused. Connect it to anything you need buffered.

  var ps = require('pause-stream')();

  badlyBehavedStream.pipe(ps.pause())

  aLittleLater(function (err, data) {
    ps.pipe(createAnotherStream(data))
    ps.resume()
  })

PauseStream will buffer whenever paused. it will buffer when yau have called pause manually. but also when it's downstream dest.write()===false. it will attempt to drain the buffer when you call resume or the downstream emits 'drain'

PauseStream is tested using stream-spec and stream-tester

This is now the default case of through

4a6fe3dc2c