Skip to content

Instantly share code, notes, and snippets.

@cloudhead
Created December 17, 2009 00:27
Show Gist options
  • Save cloudhead/258373 to your computer and use it in GitHub Desktop.
Save cloudhead/258373 to your computer and use it in GitHub Desktop.
var sys = require('sys');
process.delay = function (fun) {
return setTimeout(fun, 0);
};
var func = function () {
var promise = new process.Promise();
process.delay(function () {
promise.emitSuccess("boo");
});
return promise;
}
func().addCallback(function (msg) {
sys.puts(msg + "!");
});
// boo!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment