间隔调用WCF服务的最佳方法

发布于 2024-11-23 17:14:31 字数 248 浏览 6 评论 0原文

我有几个 WCF 服务,我想以特定的时间间隔执行其中的方法。

例如,每 5 分钟调用一次 Service1.DoSomeWork,每 10 分钟调用一次 Service2.DoSomeWork。我还希望 Windows 客户端应用程序能够随时调用 DoSomeWork 方法。

实现这一点的最佳方法是什么?

我可以完全控制服务器,因此可以使用计划任务,但我想知道在 AppFabric 中使用工作流更好还是在服务本身中使用计时器更好?

I have several WCF services and I want to execute methods in them at specific intervals.

For example, call Service1.DoSomeWork every 5 minutes and Service2.DoSomeWork every 10 minutes. I also want Windows client applications to be able to call the DoSomeWork methods at any time.

What is the best way to implement this?

I have complete control over the server so using Scheduled Tasks is possible but I wonder if using a Workflow in AppFabric is better or using a timer in the service itself?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

始终不够爱げ你 2024-11-30 17:14:32

看看这篇文章。我不久前回答了一个问题,开发人员希望在 Windows 服务中每隔一段时间“做某事”。我按照本线程前面发布的其他人的建议,提供了一个非常详细的代码示例,用于在 Windows 服务中安排活动。

如何使服务动态运行基于服务运行情况

Check out this post. I answered a question a while ago where the developer want to "Do something" at an interval in a windows service. I gave a pretty detailed code sample for scheduling activity within a Windows Service as recommended by other posted earlier in this thread.

how to make service act dynamically based on service running condition

半仙 2024-11-30 17:14:32

我不熟悉 AppFabric,但如果我是你,我会使用计时器,因为你的要求听起来很简单。

I'm not familiar with AppFabric but if I were you, I will use the timer since your requirement sounds simple.

错爱 2024-11-30 17:14:32

如果我是你,

我会在服务器中创建一个 Windows 服务。

这样我就可以在特定的时间间隔做任何事情......

If I were your ,

I create a windows service in the server .

So that I can do anything at specific intervals....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文