Using Cfthread to separate intensive task from page processing
Hello there,
I have what I think is a fairly simple need to separate out a fairly intensive bit of code from the regular page processing. This is under CF8.
We have a page that does a lot of survey result analysis on tens of thousands of records. It's used very rarely and only by one or two people, but our server isn't really equipped to do that kind of thing very quickly.
The consequence is that the entire number-crunching process can push the page load to about 120 seconds. This is fine since everyone involved knows what's going on and why, but I'd display a 'Please wait' sort of message and load all of the layout so it's not just 'waiting for my.web.site...' in their browser.
I put the number crunching section of code into a cfthread and that seemed to do what I want, at last in terms of loading the rest of the page first. The problem is that the thread never outputs anything - nothing that is processed in the thread gets displayed on the page.
This is the first time I've used CFTHREAD, and I understand it conceptually from a data processing perspective (such as the examples given in the documentation when you're performing asynchronous tasks like downloading something or grabbing an external RSS feed). I'm just not sure how it relates to page processing. In other words, it seems to me that I'm either doing something simple incorrectly, or else CFTHREAD can't be used this way.
Thanks very much,
Aq
