简体   繁体   中英

Suggestion on long running process

My requirement is to create a website in which any number of user can login and click on a button. The task inside that button click will be a long running process (May take hours or days to finish the task). User can logout from the website and can login occasionally to check the status of the task.Is it good to use the idea in this article. Please give some suggestion on this.

Thanks.

MSMQ or SQL Service Broker used to communicate with a Windows Service.

asp.net page sends start request
                       ------------MSMQ------------>
                                              Windows service picks up message
                                              and starts the long running job.
                                              As progress is made, it can be
                                              recorded in a "Jobs" table
client checks status from the Jobs table
IIS app pool recycles
.... days pass
                                              Service completes work, and records
                                              the job as Completed

                                              Service might send email notification
                                              with a link to the webpage
client can later retrieve the rendered job

If you really must stay within IIS, I would still use MSMQ or SQL Server, but you would just have to put your service code in Application_Start .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM