|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
calling a template but not waiting for it to finish running
I have some code that I would like to run with each page request, but itMatthew Smith 03/09/10 02:23 P Read up on "threading", which CF implements with the cfthread tag.Peter Boughton 03/09/10 02:25 P cool, I'll check it out.Matthew Smith 03/09/10 02:27 P If you are using CF8 or CF9 - I'd looked into what can be done withWil Genovese 03/09/10 02:36 P On 3/9/2010 11:36 AM, Wil Genovese wrote:Ian Skinner 03/09/10 02:49 P Yes, find it clean to set up a gateway instance and then call SendGatewayMessage() for background processing.Jon Sala 03/09/10 02:58 P >you can also do a <cfhttp...> with a timeout value of 0.Matthew Smith 03/09/10 04:27 P On 3/9/2010 1:20 PM, Matthew Smith wrote:Ian Skinner 03/09/10 05:30 P Check out cfthread.Bobby 03/09/10 02:39 P I have some code that I would like to run with each page request, but it might take a while and I'd like to not have to wait for it to finish running. So basically, I'd like to initiate a template in Application.cfm, without a cfinclude. Is this possible? This will be on crystaltech, a shared hosting enviroment, so please keep in mind the tag restrictions. Read up on "threading", which CF implements with the cfthread tag. cool, I'll check it out. > > Read up on "threading", which CF implements with the cfthread tag. If you are using CF8 or CF9 - I'd looked into what can be done with cfthread. And I would not put that into the Application.cfm (should be using Application.cfc anyways - you can do more with it), that kind of code should be executed from your controller for every page request. Spawn the thread at the beginning of the request then gather the results in at the end of the request. Another way is to use AJAX. Wil ----- Excess quoted text cut - see Original Post for more ----- On 3/9/2010 11:36 AM, Wil Genovese wrote: > Another way is to use AJAX. > > Wil > Yet another way, if you want to go old school - before the days of <cfthread...> you can also do a <cfhttp...> with a timeout value of 0. Another new school way that may be relevant, is ColdFusion gateways. Really depends on what one is actually trying to accomplish. Yes, find it clean to set up a gateway instance and then call SendGatewayMessage() for background processing. Not sure if Matthew's Crystaltech will let him access that. On 3/9/2010 11:36 AM, Wil Genovese wrote: > Another way is to use AJAX. > > Wil > Yet another way, if you want to go old school - before the days of <cfthread...> you can also do a <cfhttp...> with a timeout value of 0. Another new school way that may be relevant, is ColdFusion gateways. Really depends on what one is actually trying to accomplish. >you can also do a <cfhttp...> with a timeout value of 0. Much easier. Any drawbacks? I don't need any values back from the request, I just need it to run. ----- Excess quoted text cut - see Original Post for more ----- On 3/9/2010 1:20 PM, Matthew Smith wrote: ----- Excess quoted text cut - see Original Post for more ----- Other than it is much more limited in capabilities then the modern <cfthread...> equivalent, if it meets your needs within its limitations the is nothing wrong with the technique. Just realize that there is *zero* way to know what the results of the abandon request was, so if it is throwing errors or not doing what it is supposed to be doing, it is not going to be telling you of its problems. Check out cfthread. I have some code that I would like to run with each page request, but it might take a while and I'd like to not have to wait for it to finish running. So basically, I'd like to initiate a template in Application.cfm, without a cfinclude. Is this possible? This will be on crystaltech, a shared hosting enviroment, so please keep in mind the tag restrictions.
|
July 31, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||