Giter VIP home page Giter VIP logo

Comments (5)

shatl avatar shatl commented on June 11, 2024

Thanks for suggestion Mike.
My idea was to provide basic registration facilities which will allow other developers to customize them to fit their needs :)

I'll look at the Autofac.Multitenant implementation. Most probably this enhancement will go to separate package as it introduces extra dependency.

from autofac.extras.quartz.

MichaelWeatherton avatar MichaelWeatherton commented on June 11, 2024

Sorry for the distraction of including the .InstancePerTenant(); in the code, which yes, would introduce another package dependency. The main point was to first resolve the current IComponentContext from the initial IComponentContext:

var ctx = c.Resolve<IComponentContext>();

And then use ctx to resolve any further dependencies.

In autofac, the initial IComponentContext supplied in the lambda expression registrations will be the root scope unless the BeginLifetimeScope declaration specifies a tag.

This likely works for 99% of autofac implementations. But even using vanilla autofac with no extra dependencies, this registration would not be compatible with any nested lifetime scope, such as tagged lifetime scope InstancePerMatchingLifetimeScope (what multitenant uses under the covers) or InstancePerRequest. InstacePerRequest should not apply here since it wouldn't be a good idea to use jobs in the scope of an HttpRequest, but just illustrating the point. This is sort of less than documented issue with autofac. I can create a test that demonstrates this if you need.

Thanks for looking at this, and I really appreciate the package!

from autofac.extras.quartz.

shatl avatar shatl commented on June 11, 2024

@MichaelWeatherton Can you create a sample to play with please? I never used Autofac.Multitenant so your sample will be very useful.

If I understand correctly, if scheduler is declared with InstancePerMatchingLifetimeScope() (which is Multitenant does), c will point to root context, rather than matching scope. Is this correct.

Thanks

from autofac.extras.quartz.

shatl avatar shatl commented on June 11, 2024

@MichaelWeatherton any updates?

from autofac.extras.quartz.

lock avatar lock commented on June 11, 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.