Skip to content

Instantly share code, notes, and snippets.

@hns
Created August 31, 2010 08:19
Show Gist options
  • Save hns/558718 to your computer and use it in GitHub Desktop.
Save hns/558718 to your computer and use it in GitHub Desktop.
var {AsyncResponse} = require("ringo/webapp/response");
var {setTimeout} = require("ringo/scheduler");
exports.app = function(req) {
var res = AsyncResponse(req, 30000, true);
setTimeout(function() {
res.start(200, {"Content-Type": "text/html; charset=utf-8"});
res.write("Hallo Welt");
}, 1000);
setTimeout(function() {
res.write("<br>wie geht's?");
}, 2000);
setTimeout(function() {
res.write("<br>Es ist schön hier!");
res.close();
}, 3000);
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment