Autofac.Extras.Quartz
10.0.0-alpha0007
See the version list below for details.
dotnet add package Autofac.Extras.Quartz --version 10.0.0-alpha0007
NuGet\Install-Package Autofac.Extras.Quartz -Version 10.0.0-alpha0007
<PackageReference Include="Autofac.Extras.Quartz" Version="10.0.0-alpha0007" />
paket add Autofac.Extras.Quartz --version 10.0.0-alpha0007
#r "nuget: Autofac.Extras.Quartz, 10.0.0-alpha0007"
// Install Autofac.Extras.Quartz as a Cake Addin #addin nuget:?package=Autofac.Extras.Quartz&version=10.0.0-alpha0007&prerelease // Install Autofac.Extras.Quartz as a Cake Tool #tool nuget:?package=Autofac.Extras.Quartz&version=10.0.0-alpha0007&prerelease
Autofac.Extras.Quartz
Autofac integration package for Quartz.Net.
Autofac.Extras.Quartz creates nested litefime scope for each Quartz Job. Nested scope is disposed after job execution has been completed.
This allows to have single instance per job execution as well as deterministic disposal of resources.
Install package via Nuget: install-package Autofac.Extras.Quartz
Build status
Stable | Pre-release | |
---|---|---|
Build | ||
NuGet | ||
CodeCov |
Usage example
Autofac configuration for Quartz includes two steps:
- Scheduler registration
- Job registration
Scheduler registration
QuartzAutofacFactoryModule
registers custom ISchedulerFactory
and default instance of IScheduler
in Autofac container.
Both factory and schedulere are registered as singletones.
Note: Is is important to resolve IScheduler
from container, rather than using default one to get jobs resolved by Autofac.
Optionally custom Quartz configuration can be passed using ConfigurationProvider
property. Provider is callback which returns settings using NameValueCollection
.
Job scope configuration
Starting with version 7 QuartzAutofacFactoryModule
provides a way to customize lifetime scope configuration for job. This can be done via JobScopeConfigurator
parameter.
cb.Register(_ => new ScopedDependency("global"))
.AsImplementedInterfaces()
.SingleInstance();
cb.RegisterModule(new QuartzAutofacFactoryModule {
JobScopeConfigurator = (builder, jobScopeTag) => {
// override dependency for job scope
builder.Register(_ => new ScopedDependency("job-local "+ DateTime.UtcNow.ToLongTimeString()))
.AsImplementedInterfaces()
.InstancePerMatchingLifetimeScope(jobScopeTag);
}
});
See src/Samples/Shared/Bootstrap.cs for details.
Job registration
QuartzAutofacJobsModule
scans given assemblies and registers all non-abstract implementors of IJob
interface as transient instances.
internal static ContainerBuilder ConfigureContainer(ContainerBuilder cb)
{
// 1) Register IScheduler
cb.RegisterModule(new QuartzAutofacFactoryModule());
// 2) Register jobs
cb.RegisterModule(new QuartzAutofacJobsModule(typeof (CleanupExpiredAnnouncemetsJob).Assembly));
}
Starting Quartz
Make sure to start the scheduler after it was resolved from Autofac. E.g.
var scheduler = _container.Resolve<IScheduler>();
scheduler.Start();
Sample projects
- See src/Samples/Console for .NetCore console application.
- src/Samples/Shared contains source code shared between samples.
TopShelf-based sample was removed since Topshelf.Quartz is not compatible with Quartz 3 as af now.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Autofac (>= 8.0.0 && < 9.0.0)
- JetBrains.Annotations (>= 2023.3.0)
- Quartz (>= 3.8.1 && < 4.0.0)
-
.NETStandard 2.1
- Autofac (>= 8.0.0 && < 9.0.0)
- JetBrains.Annotations (>= 2023.3.0)
- Quartz (>= 3.8.1 && < 4.0.0)
-
net6.0
- Autofac (>= 8.0.0 && < 9.0.0)
- JetBrains.Annotations (>= 2023.3.0)
- Quartz (>= 3.8.1 && < 4.0.0)
-
net7.0
- Autofac (>= 8.0.0 && < 9.0.0)
- JetBrains.Annotations (>= 2023.3.0)
- Quartz (>= 3.8.1 && < 4.0.0)
-
net8.0
- Autofac (>= 8.0.0 && < 9.0.0)
- JetBrains.Annotations (>= 2023.3.0)
- Quartz (>= 3.8.1 && < 4.0.0)
NuGet packages (14)
Showing the top 5 NuGet packages that depend on Autofac.Extras.Quartz:
Package | Downloads |
---|---|
Lauener.Core.Triggers
A easy to use Quartz implementation |
|
TripleSix.Core
Package Description |
|
HwApp.Quartz
HwApp Quartz & Quartzmin |
|
SyWaterStandardLibrary
舜禹框架Core 3.0 |
|
Cogito.Quartz.Autofac
Provides utilites and extensions for Quartz and Autofac. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Autofac.Extras.Quartz:
Repository | Stars |
---|---|
PlexRipper/PlexRipper
A cross-platform media downloader for Plex, designed to seamlessly add content to your own Plex server!
|
Version | Downloads | Last updated |
---|---|---|
10.0.0 | 107,597 | 3/7/2024 |
10.0.0-alpha0007 | 120 | 3/5/2024 |
10.0.0-alpha0006 | 135 | 3/4/2024 |
9.0.0 | 192,345 | 3/27/2023 |
8.2.0 | 63,321 | 1/30/2023 |
8.2.0-alpha0001 | 190 | 1/30/2023 |
8.1.0 | 2,373 | 1/24/2023 |
8.1.0-alpha0003 | 215 | 12/22/2022 |
8.1.0-alpha0002 | 193 | 12/22/2022 |
8.0.0 | 140,024 | 6/3/2022 |
7.4.0-alpha0007 | 254 | 6/2/2022 |
7.4.0-alpha0005 | 9,167 | 5/17/2022 |
7.4.0-alpha0002 | 199 | 5/8/2022 |
7.3.0 | 185,669 | 10/28/2021 |
7.3.0-alpha0009 | 284 | 10/28/2021 |
7.2.0 | 49,017 | 8/2/2021 |
7.2.0-alpha0006 | 297 | 8/1/2021 |
7.1.0 | 65,992 | 4/25/2021 |
7.1.0-alpha0011 | 308 | 8/1/2021 |
7.1.0-alpha0010 | 341 | 8/1/2021 |
7.1.0-alpha0009 | 359 | 8/1/2021 |
7.1.0-alpha0008 | 308 | 6/20/2021 |
7.1.0-alpha0006 | 297 | 4/30/2021 |
7.1.0-alpha0004 | 305 | 4/24/2021 |
7.1.0-alpha0003 | 342 | 4/24/2021 |
7.1.0-alpha0002 | 294 | 4/19/2021 |
7.1.0-alpha0001 | 284 | 4/19/2021 |
7.0.0 | 196,233 | 2/16/2021 |
7.0.0-beta0001 | 297 | 2/14/2021 |
7.0.0-alpha0024 | 315 | 2/14/2021 |
7.0.0-alpha0023 | 318 | 2/9/2021 |
6.3.0-alpha0001 | 310 | 2/9/2021 |
6.2.0 | 14,174 | 1/29/2021 |
6.2.0-beta0001 | 302 | 1/29/2021 |
6.2.0-alpha0008 | 315 | 1/28/2021 |
6.2.0-alpha0001 | 433 | 1/10/2021 |
6.1.0 | 17,707 | 1/10/2021 |
6.1.0-beta0001 | 348 | 1/4/2021 |
6.0.1 | 44,457 | 10/21/2020 |
6.0.1-beta0001 | 453 | 10/21/2020 |
6.0.0 | 65,584 | 10/9/2020 |
6.0.0-beta0001 | 416 | 10/9/2020 |
6.0.0-alpha0041 | 425 | 10/7/2020 |
6.0.0-alpha0039 | 455 | 10/7/2020 |
5.4.0 | 38,472 | 10/7/2020 |
5.4.0-beta0001 | 420 | 10/4/2020 |
5.4.0-alpha0007 | 414 | 10/4/2020 |
5.4.0-alpha0001 | 643 | 8/6/2020 |
5.3.0 | 37,993 | 8/6/2020 |
5.3.0-beta0001 | 439 | 8/6/2020 |
5.3.0-alpha0009 | 449 | 8/6/2020 |
5.3.0-alpha0008 | 505 | 7/27/2020 |
5.3.0-alpha0007 | 517 | 7/8/2020 |
5.3.0-alpha0001 | 1,053 | 5/19/2020 |
5.2.0 | 106,441 | 5/19/2020 |
5.2.0-beta0001 | 479 | 5/19/2020 |
5.2.0-alpha0023 | 475 | 5/19/2020 |
5.2.0-alpha0021 | 752 | 2/17/2020 |
5.1.0 | 158,342 | 2/17/2020 |
5.1.0-alpha0015 | 472 | 2/17/2020 |
5.1.0-alpha0014 | 545 | 2/8/2020 |
5.1.0-alpha0005 | 550 | 1/30/2020 |
5.0.0 | 26,538 | 1/30/2020 |
5.0.0-beta0001 | 559 | 1/30/2020 |
5.0.0-alpha0064 | 484 | 1/30/2020 |
4.7.0-alpha0013 | 2,962 | 1/29/2020 |
4.7.0-alpha0009 | 506 | 1/27/2020 |
4.7.0-alpha0007 | 1,779 | 11/18/2019 |
4.7.0-alpha0006 | 506 | 11/17/2019 |
4.7.0-alpha0005 | 539 | 11/8/2019 |
4.7.0-alpha0004 | 1,157 | 9/2/2019 |
4.6.0 | 211,736 | 9/2/2019 |
4.6.0-beta0001 | 558 | 9/1/2019 |
4.6.0-alpha0036 | 547 | 9/1/2019 |
4.6.0-alpha0034 | 537 | 9/1/2019 |
4.6.0-alpha0033 | 526 | 9/1/2019 |
4.6.0-alpha0028 | 602 | 7/13/2019 |
4.6.0-alpha0026 | 559 | 7/13/2019 |
4.6.0-alpha0024 | 539 | 7/6/2019 |
4.6.0-alpha0022 | 536 | 7/6/2019 |
4.6.0-alpha0018 | 543 | 7/6/2019 |
4.6.0-alpha0008 | 682 | 5/8/2019 |
4.6.0-alpha0005 | 558 | 5/8/2019 |
4.6.0-alpha0003 | 589 | 5/8/2019 |
4.6.0-alpha0001 | 718 | 3/10/2019 |
4.5.1 | 174,547 | 5/8/2019 |
4.5.1-beta0001 | 590 | 5/8/2019 |
4.5.0 | 109,850 | 3/9/2019 |
4.5.0-beta0001 | 593 | 3/9/2019 |
4.5.0-alpha0008 | 563 | 3/9/2019 |
4.5.0-alpha0007 | 592 | 3/8/2019 |
4.5.0-alpha0005 | 618 | 2/25/2019 |
4.5.0-alpha0003 | 847 | 2/11/2019 |
4.5.0-alpha0002 | 667 | 1/28/2019 |
4.5.0-alpha0001 | 678 | 1/27/2019 |
4.4.0 | 104,611 | 1/27/2019 |
4.4.0-beta0001 | 710 | 1/27/2019 |
4.4.0-alpha0014 | 1,056 | 9/29/2018 |
4.4.0-alpha0013 | 772 | 9/29/2018 |
4.4.0-alpha0012 | 754 | 9/29/2018 |
4.4.0-alpha0002 | 833 | 9/23/2018 |
4.4.0-alpha0001 | 766 | 9/19/2018 |
4.3.0 | 154,310 | 9/29/2018 |
4.3.0-beta0001 | 805 | 9/26/2018 |
4.3.0-alpha0008 | 1,400 | 7/11/2018 |
4.3.0-alpha0007 | 964 | 7/7/2018 |
4.3.0-alpha0006 | 961 | 7/7/2018 |
4.3.0-alpha0005 | 970 | 7/1/2018 |
4.2.0 | 42,242 | 7/1/2018 |
4.2.0-beta0001 | 947 | 6/30/2018 |
4.2.0-alpha0004 | 945 | 7/1/2018 |
4.2.0-alpha0003 | 1,362 | 5/13/2018 |
4.2.0-alpha0002 | 991 | 5/13/2018 |
4.2.0-alpha0001 | 1,000 | 5/13/2018 |
4.1.2 | 1,246 | 6/30/2018 |
4.1.1 | 60,851 | 5/13/2018 |
4.1.0-beta0004 | 996 | 5/13/2018 |
4.1.0-beta0001 | 1,008 | 5/13/2018 |
4.1.0-alpha0016 | 1,328 | 4/14/2018 |
4.0.0 | 65,998 | 1/14/2018 |
4.0.0-beta0007 | 1,105 | 1/14/2018 |
4.0.0-beta0006 | 1,027 | 1/13/2018 |
4.0.0-beta0001 | 967 | 1/13/2018 |
3.5.0 | 99,938 | 4/14/2018 |
3.5.0-unstable0012 | 1,118 | 1/5/2018 |
3.5.0-unstable0010 | 1,405 | 8/15/2017 |
3.5.0-unstable0004 | 953 | 8/1/2017 |
3.5.0-unstable0003 | 964 | 7/25/2017 |
3.5.0-unstable0002 | 1,002 | 6/21/2017 |
3.5.0-unstable0001 | 1,050 | 6/15/2017 |
3.5.0-beta0001 | 1,170 | 4/14/2018 |
3.4.0 | 121,783 | 5/5/2017 |
3.4.0-unstable0009 | 1,005 | 4/5/2017 |
3.4.0-unstable0008 | 971 | 4/5/2017 |
3.4.0-unstable0007 | 999 | 4/5/2017 |
3.4.0-unstable0006 | 948 | 4/5/2017 |
3.4.0-unstable0004 | 1,080 | 2/15/2017 |
3.4.0-unstable0001 | 1,070 | 12/4/2016 |
3.4.0-ci0000 | 953 | 4/5/2017 |
3.3.0 | 72,733 | 11/1/2016 |
3.3.0-unstable0001 | 1,078 | 11/1/2016 |
3.3.0-unstable0000 | 969 | 10/10/2016 |
3.2.0 | 7,951 | 10/10/2016 |
3.2.0-beta0001 | 966 | 10/10/2016 |
3.1.0 | 56,568 | 8/25/2016 |
3.1.0-unstable0022 | 964 | 10/9/2016 |
3.1.0-unstable0021 | 999 | 10/9/2016 |
3.0.0-unstable0020 | 1,085 | 7/17/2016 |
3.0.0-unstable0017 | 1,047 | 8/24/2016 |
3.0.0-unstable0013 | 1,012 | 7/17/2016 |
3.0.0-unstable0012 | 1,023 | 7/17/2016 |
3.0.0-unstable0011 | 1,013 | 7/17/2016 |
3.0.0-beta-1 | 1,092 | 7/4/2016 |
3.0.0-alpha0014 | 969 | 7/20/2016 |
2.2.0-unstable0012 | 1,061 | 7/19/2016 |
2.1.1 | 18,956 | 7/16/2016 |
2.1.0 | 38,026 | 4/8/2016 |
2.0.0.1 | 1,643 | 4/6/2016 |
1.7.0 | 41,110 | 10/29/2015 |
1.6.0 | 3,204 | 10/25/2015 |
1.5.1 | 19,173 | 7/14/2015 |
1.5.0 | 1,360 | 7/14/2015 |
1.4.0 | 4,935 | 6/12/2015 |
1.3.0 | 16,808 | 2/1/2015 |
1.2.0 | 3,164 | 1/26/2015 |
1.1.1 | 6,255 | 11/15/2014 |
1.1.0 | 10,180 | 7/13/2014 |
1.0.0 | 2,750 | 7/2/2014 |
0.11.0 | 1,908 | 5/18/2014 |
0.10.0 | 1,799 | 4/9/2014 |
0.9.0 | 5,603 | 4/7/2014 |