使用什么来执行重复性(每日、每周、每月)任务?工作流程、Windows 服务还是其他什么?

发布于 2024-08-30 19:25:27 字数 392 浏览 6 评论 0原文

我编写 Windows 服务已经有一段时间了,对于需要每天运行、每周运行几次、每月运行一次等的事情来说,它们似乎总是工作得很好。但我最近一直在考虑使用 Windows Workflow Foundation 。

但是,我不确定它们如何在没有容器应用程序(例如 SharePoint)的服务器上运行?我之前使用 Sharepoint 工作流,总是遇到很大的问题,首先是工作流架构实现中的错误(睡眠和延迟问题),后来当它们最终开始工作时,它们很难管理和更改。

另一方面,Windows 服务总是很容易实现,很容易为它们创建设置并安装它们,而且它们总是很有弹性(它们通常可以工作几个月而不会崩溃或出现其他问题)。

你有什么建议吗?请记住我们正在使用.NET(版本没有问题,如果4.0在这个主题上带来了新的东西,我们可以使用它)。

I've been writing Windows Services for a while and they always seem to work fine for things that need to run every day, few times a week, once a month, etc. but I've been lately thinking about going with Windows Workflow Foundation.

However, I am unsure how would they run on a server without some container application (for instance SharePoint)? I worked with Sharepoint workflows before and I always had huge problems, at first with the bugs in the workflow architecture implementation (the problems with sleep and delay) and later when they eventually started to work, they were difficult to manage and change.

On the other hand Windows Services were always quite easy to implement, easy to create a setup for them and install them and they were always quite resilient (they were often working for months without crashing or something else going wrong).

What do you recommend? Please bear in mind we are working in .NET (version is of no problem, if 4.0 brings something new on this subject, we can use it).

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

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

发布评论

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

评论(2

奈何桥上唱咆哮 2024-09-06 19:25:27

您研究过 Windows 计划任务吗?它并不新鲜,但它允许您构建可以在特定日期/时间运行的应用程序。调度程序提供了很多类似于Windows服务的定制。 MSDN 文章

Have you looked into Windows Scheduled Tasks? It is not new, but it allows you to build an application that can be run at specific dates/times. The scheduler provides a lot of customization similar to windows services. MSDN Article

等往事风中吹 2024-09-06 19:25:27

我们经常选择使用Windows服务。对于重复任务和计划任务,我们使用 Quartz.Net 库。当这些任务是冗长的阻塞操作时,我们还合并了 SmartThreadPool 库。我们让Quartz创建一个作业并将其粘在SmartThreadPool中执行(因为我们遇到了Quartz中长时间运行作业的误触发问题,也因为我们有时希望将不同类型的作业分离到不同的线程池中执行)。

We often choose to use a Windows Service. For recurring and scheduled tasks, we utilize the Quartz.Net library. When those tasks are lengthy blocking operations, we also incorporate the SmartThreadPool library. We let Quartz create a job and stick it in the SmartThreadPool for execution (because we encountered misfiring trigger issues with long-running jobs in Quartz, and also because we sometimes want to separate different types of jobs into different thread pools for execution).

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