Thank you,
I may have to revisit cfthread after all since cfflush is not working
properly for me. Here's why: I am uploading a file AND returning data
to the Flex client when the upload succeeds. If I cfflush that page I
get the response in Flex (as expected in
DataEvent.UPLOAD_COMPLETE_DATA and Event.COMPLETE) but the later end
of page processing is not captured by Flex (it 'disconnects' down
after the first flush) and any further information I'd like to send to
the Flex app never makes it. So the response that you say stays open
does not seem to be - maybe this is related to the upload operation
and a normal POST would act differently, I don't know.
I am now thinking to either
1) see what cfthread can do to help
2) use cfflush as I have one and have the client poll the conversion
status via the database
My challenge is to inform the client that the upload is done, but then
also inform him when the conversion is done. I guess I expect too much
trying to do this in one operation.
Any thoughts? Polling would obviously be one possible workaround.
Cheers
Stefan
On 20 Feb 2009, at 14:47, David Henry wrote:
>
> 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:5773
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37