Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Created December 11, 2012 18:03
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 TooTallNate/ded5ae3e335d0c487895 to your computer and use it in GitHub Desktop.
Save TooTallNate/ded5ae3e335d0c487895 to your computer and use it in GitHub Desktop.
readable's "lowWaterMark" should be filled, even without a .read() call...
var Readable = require('stream').Readable;
// node v0.8.x compat
if (!Readable) Readable = require('readable-stream/readable');
var r = new Readable({ lowWaterMark: 1024 });
r._read = function (b, fn) {
console.error('_read(%d bytes)', b);
};
// this shouldn't even be necessary...
setTimeout(function () { }, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment