Last active
August 29, 2015 14:04
-
-
Save christophervigliotti/fb0fde8ad103463c9b5c to your computer and use it in GitHub Desktop.
CFThread Is In The House
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
<cfset value = '' /> | |
<cfthread name="aThread" action="run"> | |
<cfset value = objectInstance.method(anArgument) /> | |
</cfthread> | |
<cfset sleep(5000) /><!--- wait for a bit (give the thead a chance to complete) ---> | |
<cfif ((aThread.Status IS "RUNNING") || (aThread.Status IS "NOT_STARTED"))><!--- if the thread is not done, kill it ---> | |
<cfthread action="terminate" name="aThread" /> | |
<cfset sleep(500) /><!--- sleep for a bit to properly terminate the thread ---> | |
<cfset value = 'objectInstance.method did not respond in time' /> | |
</cfif> | |
<cfoutput> | |
#value# | |
</cfoutput> | |
<!--- | |
more here: http://help.adobe.com/livedocs/coldfusion/8/htmldocs/help.html?content=threads_3.html | |
---> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment