Created
August 26, 2022 16:39
-
-
Save trycf/66854162ec752d1fd159c3aea529dbb1 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains 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
<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