Quartz.net保持一个单一的调度运行asp.net [英] Quartz.net keeping a single Scheduler running asp.net
本文介绍了Quartz.net保持一个单一的调度运行asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是否理解正确吗?
ISchedulerFactory sf = new StdSchedulerFactory();
IScheduler sched = sf.GetScheduler();
sched.Start();
是StdSchedulerFactory单身?
Is the StdSchedulerFactory a singleton?
我想实现的是在我的世界,ASAX上的Application_Start启动石英调度,再后来就在我班的一个创建任务,触发,再次得到一个处理调度,并安排工作/触发
What I want to achieve is in my global,asax on Application_Start to start up the quartz scheduler, and then later on in one of my classes create the job, the trigger, get a handle again to the scheduler, and schedule the job/trigger
但事实证明,我需要重新启动调度程序,我认为它已经启动?
But as it turns out, I need to re-start the scheduler, I thought it was already started?
还是有现在超过1调度运行?
Or is there now more than 1 scheduler running?
推荐答案
嵌入在ASP.Net调度时,典型的场景是:
The typical scenarios when embedding the scheduler in ASP.Net are to:
- 创建您的调度程序作为一个单身,然后使用类似Scheduler.Instance访问它。
- 如果您使用DI,拥有集装箱给你的一个参考(单和已经开始)调度。
- 使用全局变量,并将它引用开始调度。
这篇关于Quartz.net保持一个单一的调度运行asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文