Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TryCF Gist
<cfscript>
requests = [
{"url"="https://httpbin.org/ip"},
{"url"="https://httpbin.org/uuid"},
{"url"="https://httpbin.org/uuid"},
{"url"="https://httpbin.org/uuid"},
{"url"="https://httpbin.org/uuid"}
];
maxThreads = 5;
parallel = true;
tick = getTickCount();
arrayEach(requests, function(value, index) {
var httpResult="";
cfhttp(url=value.url, result="httpResult");
value.result = httpResult.fileContent;
}, parallel, maxThreads);
writeOutput("<p>Took: #getTickCount()-tick# with parallel: #parallel#, maxThreads: #maxThreads#</p>");
writeDump(requests);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment