pause-stream

WebJar for pause-stream

License

License

MIT
Apache2
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

pause-stream
Last Version

Last Version

0.0.11
Release Date

Release Date

Type

Type

jar
Description

Description

pause-stream
WebJar for pause-stream
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dominictarr/pause-stream

Download pause-stream

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/pause-stream/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>pause-stream</artifactId>
    <version>0.0.11</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/pause-stream/
implementation 'org.webjars.npm:pause-stream:0.0.11'
// https://jarcasting.com/artifacts/org.webjars.npm/pause-stream/
implementation ("org.webjars.npm:pause-stream:0.0.11")
'org.webjars.npm:pause-stream:jar:0.0.11'
<dependency org="org.webjars.npm" name="pause-stream" rev="0.0.11">
  <artifact name="pause-stream" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='pause-stream', version='0.0.11')
)
libraryDependencies += "org.webjars.npm" % "pause-stream" % "0.0.11"
[org.webjars.npm/pause-stream "0.0.11"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : through jar [2.3,2.4)

Project Modules

There are no modules declared in this project.

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

https://github.com/dominictarr/pause-stream/commit/4a6fe3dc2c11091b1efbfde912e0473719ed9cc0

Versions

Version
0.0.11