var util         = require("util")
  , EventEmitter = require("events").EventEmitter

module.exports = (function() {
  var CustomEventEmitter = function(fct) {
    this.fct = fct
  }
  util.inherits(CustomEventEmitter, EventEmitter)

  CustomEventEmitter.prototype.run = function() {
    var self = this

    // delay the function call and return the emitter
    setTimeout(function(){
      self.fct.call(self, self)
    }, 1)

    return this
  }

  CustomEventEmitter.prototype.success =
  CustomEventEmitter.prototype.ok =
  function(fct) {
    this.on('success', fct)
    return this
  }

  CustomEventEmitter.prototype.failure =
  CustomEventEmitter.prototype.fail =
  CustomEventEmitter.prototype.error =
  function(fct) {
    this.on('error', fct)
    return this
  }

  CustomEventEmitter.prototype.done =
  CustomEventEmitter.prototype.complete =
  function(fct) {
    this.on('error', function(err) { fct(err, null) })
        .on('success', function(result) { fct(null, result) })
    return this
  }


  return CustomEventEmitter
})()

@@ -171,16 +171,155 @@
 ct = fct
+;%0A    var self = this;%0A    process.nextTick(function() %7B%0A      if (self.fct) %7B%0A        self.fct.call(self, self)%0A      %7D%0A    %7D.bind(this));
 %0A  %7D%0A  u
@@ -439,133 +439,8 @@
 this
-%0A%0A    // delay the function call and return the emitter%0A    setTimeout(function()%7B%0A      self.fct.call(self, self)%0A    %7D, 1)%0A
 %0A   

Remove setTimeout in favor of process.nextTick()