Last post Dec 03, 2009 09:19 PM by Song-Tian - MSFT
Nov 30, 2009 11:42 PM|Mobius5150|LINK
Wasent too sure where i should post this, but here it goes: Basically i have a webpage, from the web page i want to launch an (asyncronous?) task. This task involves getting info from other servers, database, and file access etc... Basically it could takea
while to complete (Compared to the speed i want the page to load at).
Heres the thing: The content of the page being displayed does not depend on the data being fetched/manipulated by the function. Therefore, i want the page to simply call the sub, and continue rendering and serving the client, without having to wait for the
process to complete in order to show data. So basically, after the function is called there will be no more communication between the initial page and the sub that is called, the sub will simply finish up, and "go away."
Is this possible? If it is, how should i implement this? Can Asynchronous calls handle this? Or must i use something else?
Again, i basically want the page to call the method, but not be slowed down direcly from the methods running (ie having to wait for it to complete.)
Dec 02, 2009 12:57 AM|Song-Tian - MSFT|LINK
From your description, I think HttpModule will be your selection. HttpModule is an event based methodology to inject pre-processing logic before any resource is requested. When any client sends a request for a resource, the request pipeline
emits a lot of events. And you could insert what you want to do.
Dec 03, 2009 10:20 AM|Mobius5150|LINK
Hi - Thanks for your response.
If i were to use an HttpModule, would i be able to have a long running sub that would not slow down page load?
Ie if i called sub New(), and it would take a year to complete (exaggeration here), would the page take a year to load, or would it load as normal?
Dec 03, 2009 09:19 PM|Song-Tian - MSFT|LINK
You could write more HttpModules and manage the sub task separately. For more about HttpMoudle, please refer:http://www.codeproject.com/KB/aspnet/HttpModuleandHttpHandle.aspx