Skip to content

Instantly share code, notes, and snippets.

@hns
Created June 15, 2010 10:35
Show Gist options
  • Save hns/438960 to your computer and use it in GitHub Desktop.
Save hns/438960 to your computer and use it in GitHub Desktop.
Example RingoJS code for making multiple asynchronous HTTP requests and waiting for all to complete
var {request} = require("ringo/httpclient");
var urls = [
"http://www.henso.com/",
"http://www.ringojs.org/wiki/",
"http://github.com/"
];
var responses = urls.map(function(url) {
return request({
url: url, async: true
});
});
for each (var response in responses) {
response.wait();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment