Correct, each request is a separate thread.  The problem is that the 
response for the request remains open after a cfflush.  You probably 
want to spawn a thread that runs without a request/response tied to it.  
cfthread allows the request from Flash to complete, cfflush would leave 
the response partially filled but still open.  If cfthread isn't an 
option then you could write a Java class to handle the threading.  Keep 
a reference to the object in the application scope so you can ask it 
when processing is done.

<cfscript>
//your implementation may vary
if (StructKeyExists(application,"myFileProcObject"){
application.myFileProcObject=CreateObject("java","yourProcessingClass").init();
}
threadId = application.myFileProcObject.processYerFile(file);
</cfscript>
<cfoutput>#threadId#</cfoutput>

When you want to check if the file is done yet:

<cfif application.myFileProcObject.isMyFileReadyYet(threadId)>
File is ready
<cfelse>
File still processing
</cfif>

When ColdFusion doesn't do what I want, I break out the Java books.  
Hope that helps.

Stefan Richter wrote:
> Apparently CF Standard only supports two concurrent threads while the  
> rest is queued, not sure how useful that will be then.
>
> How does it work in detail, say I have 10 people uploading a document  
> at the same time wouldn't the page thread be essentially multithreaded  
> anyway (one for each user)? If so maybe I could just use cfflush and  
> then add the conversion code afterwards. Would that essentially be the  
> same as starting a cfthread from that page?
>
> Regards,
>
> Stefan
>
>
>   

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

Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5771
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to