Created
March 12, 2026 04:50
-
-
Save trycf/51d027bc0cde2402e87a8e664ed27033 to your computer and use it in GitHub Desktop.
TryCF Gist
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
| <cfscript> | |
| threadSize = 200; | |
| threadList = []; | |
| for( i=1; i <= threadSize; i++ ){ | |
| threadName = "thread_test_#i#_" & replace(createUUID(), "-", "", "all"); | |
| threadList.append(threadName); | |
| thread action="run" name="#threadName#" { | |
| thread.started = true; | |
| thread.errored = false; | |
| thread.finished = false; | |
| try { | |
| sleep(randRange(500, 1500)); | |
| throw "here"; | |
| } catch (Any e){ | |
| thread.errored = true; | |
| } | |
| thread.finished = true; | |
| } | |
| } | |
| thread action="join" name="#threadList.toList()#" timeout="60000"; | |
| while(true){ | |
| allFinished = true; | |
| structEach(cfthread, function(tname, tresult){ | |
| if( !structKeyExists(tresult,"finished") || !tresult.finished ){ | |
| allFinished = false; | |
| } | |
| }); | |
| if(allFinished) break; | |
| sleep(50); | |
| } | |
| structEach(cfthread, function(tname, tresult){ | |
| if( !tresult.finished ){ | |
| dump(tresult); | |
| } | |
| }); | |
| </cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment