Created
June 15, 2010 10:35
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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