间隔调用WCF服务的最佳方法
我有几个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看看这篇文章。我不久前回答了一个问题,开发人员希望在 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
我不熟悉 AppFabric,但如果我是你,我会使用计时器,因为你的要求听起来很简单。
I'm not familiar with AppFabric but if I were you, I will use the timer since your requirement sounds simple.
如果我是你,
我会在服务器中创建一个 Windows 服务。
这样我就可以在特定的时间间隔做任何事情......
If I were your ,
I create a windows service in the server .
So that I can do anything at specific intervals....