Giter VIP home page Giter VIP logo

Comments (11)

shatl avatar shatl commented on June 5, 2024

Hello,
can you give a sample code how you are doing this?

from autofac.extras.quartz.

RedwoodForest avatar RedwoodForest commented on June 5, 2024

Sure, we register our ISchedulerFactory and IScheduler like this:

protected override void Load(ContainerBuilder builder) {
    builder.Register(CreateSchedulerFactory).SingleInstance();
    builder.Register(c => c.Resolve<ISchedulerFactory>().GetScheduler());
}

private static ISchedulerFactory CreateSchedulerFactory(IComponentContext context) {

    var schedulerFactory = DirectSchedulerFactory.Instance;

    var threadPool = new SimpleThreadPool(5, ThreadPriority.Normal);
    var jobStore = new RAMJobStore();   
    schedulerFactory.CreateScheduler(threadPool, jobStore);

    var scheduler = schedulerFactory.GetScheduler();
    scheduler.JobFactory = context.Resolve<IJobFactory>();

    return schedulerFactory;
}

Some ways this could be incorporated into this project are:

One approach would be to use composition instead inheritance and have AutofacSchedulerFactory implement ISchedulerFactory by delegating to an ISchedulerFactory passed into the constructor (defaulting to StdSchedulerFactory if no factory is provided).

Another approach would be that since all AutofacSchedulerFactory does is set the job factory you could eliminate this class and allow an ISchedulerFactory to be passed in to QuartzAutofacFactoryModule (again defaulting to StdSchedulerFactory).

from autofac.extras.quartz.

kjellski avatar kjellski commented on June 5, 2024

👍 I would like to have that possibility too, I'll have a look into your codebase :)

from autofac.extras.quartz.

kjellski avatar kjellski commented on June 5, 2024

@lawrencejohnston there is a solution in the source from #5, I don't know about a release, but you can have a look, @shatl already merged it 👍

from autofac.extras.quartz.

shatl avatar shatl commented on June 5, 2024

Guys, I'll review approach and release new version this weekend.

from autofac.extras.quartz.

RedwoodForest avatar RedwoodForest commented on June 5, 2024

@kjellski @shatl Thank you both for your efforts on this. As soon as the new release is out we'll switch over to it.

from autofac.extras.quartz.

kjellski avatar kjellski commented on June 5, 2024

@shatl thanks for having a look, maybe I could've spended another sentence on the public function to be set...

@lawrencejohnston that's what it's all about, just take a hit on OSS and it will come back to you :)

from autofac.extras.quartz.

shatl avatar shatl commented on June 5, 2024

Guys, I've introduced configuration provider for factory module, please have a look.

I'll release it this weekend

from autofac.extras.quartz.

shatl avatar shatl commented on June 5, 2024

As a separate effort, I'm going to create fluent configuration interface. Not sure if it will go to Quartz itself or to separate assembly.

from autofac.extras.quartz.

kjellski avatar kjellski commented on June 5, 2024

👍 /signed ;)

from autofac.extras.quartz.

lock avatar lock commented on June 5, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from autofac.extras.quartz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.