Quartz Scheduler中Cron触发器和简单触发器的区别 [英] Difference Between Cron trigger and Simple trigger in Quartz Scheduler

查看:45
本文介绍了Quartz Scheduler中Cron触发器和简单触发器的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在探索石英调度器,

I am exploring on quartz scheduler,

除了它们的定义方式之外,Cron 触发器和简单触发器之间有什么区别.我没有发现任何其他差异.

What are the differences between Cron trigger and Simple trigger except for how they are being defined. I dint find any other differences.

比如哪个是线程安全的,哪个被称为最佳实践或类似的东西.

like which is thread safe or which is said as best practice or anything like that.

谁能解释一下它们之间的区别以及我们可以在哪些场景下使用它们

can someone explain what are the differences between them and at what scenarios we could use them

推荐答案

两者之间的区别仅在于您希望如何安排作业的执行.在最佳实践或线程安全方面没有其他区别.

The differences between the two are merely how you wish to schedule the execution of your jobs. There are no other differences in terms of best practices or thread safety.

SimpleTrigger 对于您希望在特定时间只执行一次的作业非常有用,可以选择在特定时间间隔重复执行.

SimpleTrigger is useful for jobs that you want to execute exactly once at a specific time, optionally followed by repeated execution at a specific interval.

CronTrigger 有很大不同,因为它适用于在某些基于日历的计划中固有地重复出现的作业.因此,使用 CronTrigger,您可以安排每周日凌晨 1 点运行的作业.

CronTrigger is much different in that it is for jobs that are inherently recurring on some calendar based schedule. So with CronTrigger you can schedule a job that runs every Sunday at 1AM.

CronTriggerSimpleTrigger 教程包含一些更详细的解释和示例.

The CronTrigger and SimpleTrigger tutorials contain some more detailed explanations and examples.

这篇关于Quartz Scheduler中Cron触发器和简单触发器的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆