Skip to content

Instantly share code, notes, and snippets.

@thomasboyt
Created August 8, 2011 11:53
Show Gist options
  • Save thomasboyt/1131628 to your computer and use it in GitHub Desktop.
Save thomasboyt/1131628 to your computer and use it in GitHub Desktop.
Request Manager Example
for (var i=0; i < 10; i++) {
reqManager.createReq({
url: "https://api.github.com/repos/jquery/jquery/pulls/" + i + "?callback=?",
type: "get",
dataType: "jsonp",
// callback for when this request has completed
onSuccess: savePullRequest
});
}
var reqManager = $.reqManager({
totalRequests: 10,
// callback for when all requests have completed
onFinished: downloadsFinished
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment