dimanche 28 juin 2015

What is the proper scoping for a Quartz.net Scheduler instance in ASP.NET applications?

I'm running Quartz.net in-process with my ASP.NET MVC application.

To start the scheduler you of course have to do something like this:

    ISchedulerFactory schedulerFactory;
    IScheduler scheduler;
    schedulerFactory = new StdSchedulerFactory(properties);
    scheduler = schedulerFactory.GetScheduler();
    scheduler.Start();

Assuming that I want only a single instance of the scheduler in my application (is this a good assumption?), is it a best practice to simply define scheduler as static so that I have access to the scheduler throughout the application?

Aucun commentaire:

Enregistrer un commentaire