Skip to content

Instantly share code, notes, and snippets.

Created April 8, 2015 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/fd172cd79a6358f2d742 to your computer and use it in GitHub Desktop.
Save anonymous/fd172cd79a6358f2d742 to your computer and use it in GitHub Desktop.
var stream = require('stream');
var r = new stream.Readable({
highWaterMark: 0, //What exactly is the behaviour with a 0 buffer?
read: function() {
console.log('Read');
this.push('abc');
}
});
//`read` is called twice? The same happens when piping into another stream with highWaterMark: 0 or 1
r.on('data', function(data) {
r.pause();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment