Skip to content

Instantly share code, notes, and snippets.

@earl
Forked from hns/async-jsgi.js
Created May 11, 2010 14:03
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 earl/397345 to your computer and use it in GitHub Desktop.
Save earl/397345 to your computer and use it in GitHub Desktop.
var {defer} = require("ringo/promise");
var {setTimeout} = require("ringo/scheduler");
exports.delayed = function(request) {
var response = defer();
setTimeout(function() {
response.resolve({
status: 200, headers: {}, body: ["Delayed"]
});
}, 1000);
return response;
}
exports.now = function(req) {
var response = defer();
response.resolve({
status: 200, headers: {}, body: ["Now"]
});
return response;
}
@hns
Copy link

hns commented May 11, 2010

yes, this does look better. You're pretty obsessed with details, I think that's great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment