M
Mark Rae
Hi,
I've seen several articles about using System Timers in ASP.NET solutions,
specifically setting them up in Global.asax' Application_OnStart event.
I'm thinking about the scenario where I might need to carry out some
back-end processing without pausing the individual users' Session while that
process runs.
E.g. I might provide the ability for a user to upload a text file of job
numbers, the purpose of which is to flag the job as completed in a SQL
Server database, and send an email to the owner of the job telling them that
their job is completed. It might take half a second or so to process each
job, but the user is allowed to upload a text file containing a maximum of
100 records, so this would make them wait around 50 seconds while the file
is processed. Unacceptable.
Ordinarily, this would be a perfect candidate for MSMQ or a Windows service.
However, my ISP does not support MSMQ or allow me to deploy Windows
services, so the only options open to me (AFAIK) are the .NET Framework v1.1
and SQL Server 2000, though I do have access to my site's aspnet_client
directory.
Therefore, I wondered if it might be possible to instantiate a System.Timer
in the Application_OnStart event which would make a call to a static
function in a Class module which "sniffed" for these uploaded files and
processed them. This would be the same amount of work for ASP.NET to do, but
the user would not have to wait while their file was processed. Instead, I'd
display a message telling them that their file has been successfully
uploaded and "will be processed in the next few minutes" or something.
Looking for some advice. Is this a good idea, not a good idea, a really
stupid idea...?
Any other suggestions for achieving this within the confines of what my ISP
offers?
Any assistance gratefully received.
Mark Rae
I've seen several articles about using System Timers in ASP.NET solutions,
specifically setting them up in Global.asax' Application_OnStart event.
I'm thinking about the scenario where I might need to carry out some
back-end processing without pausing the individual users' Session while that
process runs.
E.g. I might provide the ability for a user to upload a text file of job
numbers, the purpose of which is to flag the job as completed in a SQL
Server database, and send an email to the owner of the job telling them that
their job is completed. It might take half a second or so to process each
job, but the user is allowed to upload a text file containing a maximum of
100 records, so this would make them wait around 50 seconds while the file
is processed. Unacceptable.
Ordinarily, this would be a perfect candidate for MSMQ or a Windows service.
However, my ISP does not support MSMQ or allow me to deploy Windows
services, so the only options open to me (AFAIK) are the .NET Framework v1.1
and SQL Server 2000, though I do have access to my site's aspnet_client
directory.
Therefore, I wondered if it might be possible to instantiate a System.Timer
in the Application_OnStart event which would make a call to a static
function in a Class module which "sniffed" for these uploaded files and
processed them. This would be the same amount of work for ASP.NET to do, but
the user would not have to wait while their file was processed. Instead, I'd
display a message telling them that their file has been successfully
uploaded and "will be processed in the next few minutes" or something.
Looking for some advice. Is this a good idea, not a good idea, a really
stupid idea...?
Any other suggestions for achieving this within the confines of what my ISP
offers?
Any assistance gratefully received.
Mark Rae