Created
May 27, 2014 16:10
-
-
Save Kuirak/49d2e9058d1e779d0f9f 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
util.inherits(ConstantStream,stream.Readable); | |
function ConstantStream(constant){ | |
stream.Readable.call(this,{objectMode:true}); | |
this.constant =constant; //get count form Cache | |
} | |
ConstantStream.prototype._read = function(){ | |
var value ={}; | |
value.name ='constant'; | |
value.data =this.constant; | |
this.push([value]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment