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

查看:23
本文介绍了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 从客户端定期轮询.(优点:部署简单,没有防火墙干扰缺点:不优雅、消耗资源等)

  • 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)并在取得进展时从服务器启动回调(优点:优雅、高效,缺点:部署噩梦)

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

[你的建议???]

您对此有何看法?

推荐答案

这里有一个 post 由 Dan Wahlin 关于如何为 Silverlight 应用程序创建 WCF 进度指示器.这应该会有所帮助.

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天全站免登陆