Skip to content

Instantly share code, notes, and snippets.

@cainus
Last active December 20, 2015 03:39
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 cainus/6064904 to your computer and use it in GitHub Desktop.
Save cainus/6064904 to your computer and use it in GitHub Desktop.
var util = require("util");
var Readable = require('readable-stream').Readable;
function TestStream(){
Readable.call(this); // kind of a big deal
}
util.inherits(TestStream, Readable);
TestStream.prototype._read = function(){
that.push("asdfasdfasdf");
};
var testStream = new TestStream();
testStream.on('readable', function(){
console.log("readable! ", arguments);
testStream.read();
});
@mscdex
Copy link

mscdex commented Jul 23, 2013

Line 9 needs to be moved to line 5.

@cainus
Copy link
Author

cainus commented Jul 23, 2013

Thanks... I forgot the call to the Readable ctor too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment