WCF中针对长时间运行的进程的进度通知-如何? [英] Progress notification in WCF for long running processes - How?

查看:125
本文介绍了WCF中针对长时间运行的进程的进度通知-如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须设计和实现一种方法来处理客户端/服务器应用程序中长时间运行的进程.典型的长时间运行过程将/可能需要2-3分钟.同时,我还需要向UI报告进度,并使UI保持响应状态.

I have to design and implement a way to deal with long running processes in a client/server application. A typical long running process would/could take 2-3 minutes. I also need to report progress to the UI in the meantime and keep the UI responsive.

我想到了以下几种解决方法:

Having these in my mind I though of a few solutions:

  • 一个异步请求来启动进程,该进程启动服务器端进程并返回分配的LRPID(长时间运行的进程ID),然后定期使用该LRPID从客户端进行轮询. (专业:易于部署,没有防火墙困扰 Con :不雅观,占用资源等.)

  • One async request to start the process which starts the server-side process and returns an assigned LRPID (Long Running Process ID) then poll periodically from the client using that LRPID. (Pro: simple to deploy, no firewall messing around Con: Unelegant, resource consuming etc.)

使用双工绑定(例如NetTcpBinding)并在进度取得进展时从服务器启动回调( Pro :优雅,高效, Con :部署噩梦)

Use a duplex binding (such as NetTcpBinding) and initiate callbacks from the server as progress is being made (Pro: Elegant, efficient, Con: Deployment nightmare)

[您的建议???]

[Your suggestion???]

您对此有何看法?

推荐答案

这是

Here is a post by Dan Wahlin about how to create a WCF Progress Indicator for a Silverlight Application. This should be of some help.

这篇关于WCF中针对长时间运行的进程的进度通知-如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆