Long-Time Process on web (ASP.NET Long-Running Operations)
  TnD0WQEygW8e 2023年11月18日 29 0

a) Creating a webservice that calls a Thread?
b) Creatinga webservice with [SoapDocumentMethod(OneWay=true)]
c) Any better way? without using an external program?

Another way is queuing jobs. MSMQ or Service Broker (SQL Server 2005).
1. Create a job class instance in .NET and assign a unique id to it (GUID,
auto incr in some table).

public class Job    
{    
string ID;    
}


1.1 This class is a great place to put in the criterias required to perform
the long-running task.
2. Track the job. For example: with the Ticket (Job.ID), INSERT TABLE
tblJobs SET Completed = FALSE WHERE ID = @ID
3. When the job is done make sure the job executor updates the completion
bucket to say the job is done.
UPDATE tblJobs SET Completed = TRUE WHERE ID = @ID
4. Until then, give your response page the Job ID. It will refresh (great
place to add an AJAX enabled progress bar) and use that ticket to check
whether the job is done or not in the completion bucket:
With the Ticket (Job.ID), Query for SELECT TOP 1 WHERE Completed = TRUE AND
ID = @ID

 

http://www.beansoftware.com/ASP.NET-Tutorials/Long-Operations.aspx

http://www.velocityreviews.com/forums/t119804-long-process-in-aspnet.html

http://msdn.microsoft.com/zh-cn/magazine/cc163725(en-us).aspx

http://stackoverflow.com/questions/579861/handling-long-page-execution-times-in-asp-net

http://www.ajaxmatters.com/articles/asp/long_run_process_p1.aspx

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23091386.html

http://www.eggheadcafe.com/articles/20051223.asp

http://geekswithblogs.net/joycsharp/archive/2007/11/22/117039.aspx

http://www.aspfree.com/c/a/VB.NET/Executing-LongRunning-Tasks-with-the-Progress-Bar-in-ASPNET/

http://www.codeproject.com/KB/aspnet/asynctransactionhandler.aspx

http://dotnetslackers.com/ASP_NET/re-17817_ASP_NET_Long_Running_Tasks_with_Page_Feedback.aspx

http://weblogs.asp.net/ssharrock/archive/2004/02/02/66321.aspx

http://msdn.microsoft.com/en-us/magazine/2009.01.longrunwf.aspx

http://codebetter.com/blogs/peter.van.ooijen/archive/2006/06/20/146582.aspx

http://forums.asp.net/t/1276827.aspx

http://www.velocityreviews.com/forums/t116366-running-long-process-from-aspnet.html

http://stackoverflow.com/questions/617105/asp-net-httphandlers-and-long-running-processes

http://www.marklio.com/marklio/PermaLink,guid,de1c560e-9f2f-43e3-830e-3e195fbebea5.aspx



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月18日 0

暂无评论

推荐阅读
  wURKzOHw9Irf   2023年12月24日   30   0   0 HTMLicoicohtml
  8l4CZpTOKa7P   2023年12月26日   40   0   0 htmlhtml
  dwHry2iKGG0I   2023年12月26日   31   0   0 githubgithubhtmlhtml
TnD0WQEygW8e