Comments (11)
Hello,
can you give a sample code how you are doing this?
from autofac.extras.quartz.
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.
👍 I would like to have that possibility too, I'll have a look into your codebase :)
from autofac.extras.quartz.
@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.
Guys, I'll review approach and release new version this weekend.
from autofac.extras.quartz.
@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.
@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.
Guys, I've introduced configuration provider for factory module, please have a look.
I'll release it this weekend
from autofac.extras.quartz.
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.
👍 /signed ;)
from autofac.extras.quartz.
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)
- Add .NET 7 preview support
- Upgrade build system to Cake 2.x HOT 1
- Upgrade Autofac to 6.4.0
- Drop .NET 5 support
- Multitenancy support HOT 1
- Update Quartz.NET to 3.5.0
- Add .NET 7 support
- Upgrade Autofac to 6.5.0
- Upgrade JetBrains.Annotations to 2022.3.1
- Drop .NET Core 3.1
- Upgrade Quartz.Net to 3.6.0
- Fix appveyor failing builds for PRs
- Treat nullable-related warnings as errors
- Package generation improvements
- Add support for Autofac v7 HOT 4
- Upgrade Quartz.Net to 3.6.2
- Fix NETSDK1194 error
- Add .NET 8 support
- Add readme to nuget package
- Quartz properties does not work currently HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autofac.extras.quartz.