Skip to content

Instantly share code, notes, and snippets.

@oroce
Created February 25, 2014 16:48
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 oroce/9212832 to your computer and use it in GitHub Desktop.
Save oroce/9212832 to your computer and use it in GitHub Desktop.
var util = require('util');
var Transform = require('stream').Transform;
var MyTransformKlass = function(){
Transform.apply(this,arguments);
this.pause();
setTimeout(function imAsync(){
this.resume();
}.bind(this), 30000);
};
util.inherits(MyTransformKlass, Transform);
MyTransform.prototype._transform = function(data,enc,cb){
// do stuff
cb();
};
module.exports = MyTransformKlass;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment