Last active
December 20, 2015 03:39
-
-
Save cainus/6064904 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 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(); | |
}); | |
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
Line 9 needs to be moved to line 5.