在 WCF 中处理运行时间较长的进程

编程入门 行业动态 更新时间:2024-10-08 18:39:57
本文介绍了在 WCF 中处理运行时间较长的进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

在我目前正在开发的应用程序中,我们使用了多种 WCF 服务和多种方法.到目前为止,所有方法都运行时间很短,通常只是获取一些数据.我刚刚添加了一个需要更长运行时间的方法.

In the app I'm currently working on we are using a couple of WCF services with a lot of methods. Until now, all methods are very short running, often just getting some data. I've just added a method that takes a way longer time to run.

我不想在配置中提高超时时间,因为 1 分钟对于服务上的所有其他方法来说已经足够了.

I do not want to raise the timeout in the config, because 1 minute is long enough for all other methods on the service.

处理 1 个运行时间较长的方法的最佳方法是什么?我如何提供它仍在运行的反馈?

What is the best way to deal with 1 longer running method? And how do I provide feedback that it is still running?

推荐答案

将 WCF 与 WF(工作流基础)相结合似乎是这里的最佳选择.Workflow Foundation 为您提供了许多好处,包括在您长期运行的流程的整个生命周期中的长期持久性.

Combining WCF with WF (Workflow Foundation) seems like the best option here. Workflow Foundation gives you lots of goodies, including long-term persistence over the lifetime of your long-running process.

在 .NET 3.5 中,可以这样做,但很笨拙,而且工作量很大.

In .NET 3.5, it's possible to do so, but clumsy and a lot of work.

以下是该主题的一些链接:

Here are a few links for this topic:

http://channel9.msdn/posts/mwink/Introduction-to-Workflow-Services-building-WCF-Services-with-WF/http://code.msdn.microsoft/WorkflowServiceshttp://msdn.microsoft/en-us/magazine/cc164251.aspx

在 .NET 4.0 中,这些WorkflowServices"将成为新的 WF/WCF 4.0 包的重要组成部分.您基本上应该能够将任何工作流的接口公开为 WCF 服务.听起来很有前途,还没有机会自己尝试.

With .NET 4.0, these "WorkflowServices" will be a big part of the new WF/WCF 4.0 package. You should basically be able to expose an interface for any workflow as a WCF service. Sounds very promising, haven't had a chance to try it myself.

一些新内容的链接:

WCF/WF 4.0 和都柏林"http://blogs.msdn/murrayg/archive/2009/06/23/windows-azure-s-net-workflow-service-to-support-net-4-0-workflows.aspxhttp://channel9.msdn/shows/10-4/10-4-Episode-24-Monitoring-Workflow-Services/http://channel9.msdn/shows/10-4/10-4-Episode-16-Windows-Workflow-4/

马克

这篇关于在 WCF 中处理运行时间较长的进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 20:39:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1142756.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:较长   进程   时间   WCF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!