Go Cron Singleton Mode() vs Singleton Mode All()

huangapple go评论66阅读模式
英文:

Go Cron Singleton Mode() vs Singleton Mode All()

问题

我想在GO语言中使用gocron包中的调度器(Scheduler)。当我想要使用作业(Job)的单例模式时,有两种类型:

  • SingletonMode()
  • SingletonModeAll()

我只想知道这两种方法之间有什么区别。

英文:

I want to use Scheduler in GO Lang with gocron package.
And when I want to using Job Singleton Mode there are 2 types:

  • SingletonMode()
  • SingletoModeAll()

I just want to know what is the difference between these two methods.

答案1

得分: 1

  • SingletonMode():当您将其设置为单个作业时使用。
  • SingletonModeAll():当您希望将其设置为调度程序上的所有作业时使用。

请查看以下示例:

英文:
  • SingletonMode(): This is when you're setting it on a single job.
  • SingletoModeAll(): This is when you want to set it for all jobs on that scheduler.

Take a look at the examples:

huangapple
  • 本文由 发表于 2022年6月20日 14:28:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/72683030.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定