我有一个网络服务,执行可能需要几个小时才能完成的任务(按时间顺序排列)。
我愿与服务器连接的所有客户分享这项任务的地位(如果使用网络应用程序,就这样)
For example, the first client that calls the page http://localhost/process.aspx will instantiate the web service and it will call a method to start executing the task. A percentage number will be displayed showing the status of completion. I can do this by polling the web service using AJAX.
如果还有另一个客户试图打开该网页,则该网页应获得同样的百分比信息,因此不会产生新的网络服务。
How is the best way of doing this? I thought about different solutions but sooner or later I find new problems. These are some of the possible alternatives:
- Create an static object of the Web service.
- Create the object in the global.asax file.
你们是否还有其他想法? 我不太熟悉网站设计,这正促使我zy。 如果你说谎的话,我将不胜感激。
增 编