Rick,

I have not tried it the way you have described, but I do use the Java
sleep like so:

        go_to = createObject("java", "java.lang.Thread");
        go_to.sleep(5000); //sleep time in milliseconds 

Chuck

-----Original Message-----
From: Rick Faircloth [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 29, 2008 12:10 PM
To: CF-Talk
Subject: Can I Use This CFScript Like This?

I'm trying to set up a way to check the status of threads and implement
a sleep function that loops and delays a following thread's
initialization until the status of the first thread is "Completed".

I found an example in the CF8 docs using a sleep timer this is placed
just inside the opening <cfthread...> tag of the cfthread that needs to
wait.

    <cfscript>
        thread.sleepTimes=0;
        thread.initialized=false;
        while ((2_hmls_offices.Status != "COMPLETED") &&
(2_hmls_offices.Status 
                != "TERMINATED")) {
            sleep(2000);
            thread.sleeptimes++;
        }
        // Only do the post-initilization code if 2_hmls_offices is
complete.
        If (threadA.Status == "COMPLETED") {
            thread.initialized=true; 
            // Post-initialization code would go here.
        }
    </cfscript>

I understand what's happening inside the cfscript, but I'd like to
continue the processing *outside* the cfscript tag and use regular CFML,
not cfscript for the thread.

This example states, in the last line "//Post-initialization code would
go here".

Can I just use the cfscript as is and follow the cfscript block with my
cfqueries, etc., or would all my thread processing have to occur within
the cfscript block?  Is there a way to break out of the cfscript block
once the status of the first thread, "2_hmls_offices", is "Completed"
and go on to process regular CFML code?

Thanks,

Rick




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311786
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to