Created
April 8, 2015 08:25
-
-
Save anonymous/fd172cd79a6358f2d742 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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