推荐一个C#任务调度库

发布于 2024-07-13 06:59:11 字数 231 浏览 9 评论 0原文

我正在寻找一个 C# 库,最好是开源的,它可以让我以相当的灵活性来安排任务。 具体来说,我应该能够安排事情每 N 个时间单位运行一次,以及“每个工作日 XXXX 时间”或“每个星期一 XXXX 时间”。 更多的功能就更好了,但不是必需的。 这是我想在 Azure WorkerRole 中使用的东西,它会立即排除 Windows 计划任务、“at”、“Cron”以及任何需要安装和/或 GUI 才能操作的第三方应用程序。 我正在寻找图书馆。

I'm looking for a C# library, preferably open source, that will let me schedule tasks with a fair amount of flexibility. Specifically, I should be able to schedule things to run every N units of time as well as "Every weekday at XXXX time" or "Every Monday at XXXX time". More features than that would be nice, but not necessary. This is something I want to use in an Azure WorkerRole, which immediately rules out Windows Scheduled Tasks, "at", "Cron", and any third party app that requires installation and/or a GUI to operate. I'm looking for a library.

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

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

发布评论

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

评论(6

梦醒灬来后我 2024-07-20 06:59:12

我在 Java 时代就使用过 Quartz,效果非常好。 我现在将它用于一些 .Net 工作,它的效果甚至更好(当然,它已经稳定了很多年)。 所以我当然赞同对此的建议。

您应该关注的另一个有趣的事情是我刚刚开始使用的 .Net 4.0 中的新 System.Threading.Tasks。 我刚刚使用任务来并行化工作,它充分利用了多核/处理器。 我注意到那里有一个名为 TaskScheduler 的类,我没有详细查看它,但它有 QueueTask、DeQueTask 等方法。至少可能值得一些研究。

I used Quartz back in my Java days and it worked great. I am now using it for some .Net work and it works even better (of course there are a number of years in there for it to have stabalized). So I certainly second the recommendations for it.

Another interesting thing you should look at, that I have just begun to play with is the new System.Threading.Tasks in .Net 4.0. I've just been using the tasks for parallelizing work and it takes great advantage of multi cores/processors. I noticed that there is a class in there named TaskScheduler, I haven't looked at it in detail, but it has methods like QueueTask, DeQueTask, etc. Might be worth some investigation at least.

一枫情书 2024-07-20 06:59:12

我在这个问题中读到了关于 Quartz 如何安排 C# Windows 服务每天执行任务?。 它是一个 C# 库,允许灵活调度。

I read about Quartz in this question How might I schedule a C# Windows Service to perform a task daily?. It's a C# library and allows for flexible scheduling.

烟织青萝梦 2024-07-20 06:59:12

石英似乎是一个不错的解决方案。

我最近(今年)不得不为我正在从事的一个主要项目编写一个自定义任务调度程序。 他们也无法使用 Windows 任务计划程序,并且还希望能够通过上传程序集(通过 ASP.net 网站)来执行自定义功能,并让服务在指定时间执行适当的任务。

老实说,这件事有点像一场噩梦(设计和实现的难度不大,但调度逻辑有点拖沓)。

我强烈建议在决定“自己动手”(又名重新发明轮子!)之前用尽所有其他途径。

Quartz seems like a nice solution.

I've recently (this year) had to write a custom task scheduler on a major project I was working on. They too could not use the Windows Task Scheduler, and also wanted the ability to execute custom functionality by virtue of uploading assemblies (via an ASP.net website) and have the service execute the appropriate task at the specified time.

The thing was honestly a bit of a nightmare (not so much to design and implement, but the scheduling logic was a bit of a drag).

I'd highly recommend exhausting all other avenues before deciding to "roll your own" (a.k.a reinvent the wheel!).

失与倦" 2024-07-20 06:59:12

Aditi Technologies 推出了一款新的基于云的调度程序,名为 调度程序

调度程序允许开发人员通过以下方式安排任务的执行
在简单或复杂的 CRON 计划上运行的 HTTP Webhook。

There is a new cloud based scheduler from Aditi Technologies called Scheduler.

Scheduler allows developers to schedule the execution of tasks through
HTTP webhooks that run on simple or complex CRON schedules.

怪我太投入 2024-07-20 06:59:11

http://quartznet.sourceforge.net/

“Quartz.NET 是一个非常流行(原文如此!)开放的端口源 Java 作业调度框架,Quartz。”

PS:明智之举,工作时不要尝试只导航至quartz.net ;-)

http://quartznet.sourceforge.net/

"Quartz.NET is a port of very propular(sic!) open source Java job scheduling framework, Quartz."

PS: Word to the wise, don't try to just navigate to quartz.net when at work ;-)

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