Skip to content

Instantly share code, notes, and snippets.

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 trycf/66854162ec752d1fd159c3aea529dbb1 to your computer and use it in GitHub Desktop.
Save trycf/66854162ec752d1fd159c3aea529dbb1 to your computer and use it in GitHub Desktop.
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