I am new in ASP, so it may be a basic question.
I need to write a site thatdo the following flow:
-
user submit a request
-
the site says: Thank you, you will be notified to e-mail when I’ll finish.
-
user ends session
-
site do all the long proccess it have to
-
site send an e-mail
Is it possible to continue the proccess after user ends the main session?
I read a bit, and I see that async pages won’t do, so to use simple threading?
What is the best way to implement the flow?
Thanks,
Sara
You could use simple threading:
The problem with this approach is that IIS could recycle your ASP.NET application under some conditions. For example after a period of inactivity (no user requests), or if a memory threshold is hit, … This will result in aborting the execution of the long running operation.
For this reason it is better to implement such long running operations in separate services, such as a Windows Service. So you could for example host a WCF Service inside a Windows Service. This service will do all the long processing and sending of email. Then from within the ASP.NET application you could simply invoke the corresponding method of this WCF service.