Kck.BackgroundJobs.Quartz
4.8.0
See the version list below for details.
dotnet add package Kck.BackgroundJobs.Quartz --version 4.8.0
NuGet\Install-Package Kck.BackgroundJobs.Quartz -Version 4.8.0
<PackageReference Include="Kck.BackgroundJobs.Quartz" Version="4.8.0" />
<PackageVersion Include="Kck.BackgroundJobs.Quartz" Version="4.8.0" />
<PackageReference Include="Kck.BackgroundJobs.Quartz" />
paket add Kck.BackgroundJobs.Quartz --version 4.8.0
#r "nuget: Kck.BackgroundJobs.Quartz, 4.8.0"
#:package Kck.BackgroundJobs.Quartz@4.8.0
#addin nuget:?package=Kck.BackgroundJobs.Quartz&version=4.8.0
#tool nuget:?package=Kck.BackgroundJobs.Quartz&version=4.8.0
Kck.BackgroundJobs.Quartz
Quartz.NET-backed IJobScheduler implementation for fire-and-forget, delayed and cron-scheduled background jobs.
Installation
dotnet add package Kck.BackgroundJobs.Quartz
Quick Start
using Kck.BackgroundJobs.Abstractions;
// Program.cs
builder.Services.AddKckBackgroundJobsQuartz(); // in-memory store, hosted service waits for running jobs on shutdown
builder.Services.AddKckJob<DailyReportJob>(); // jobs are resolved from DI in a new scope per execution
// Define a job
public sealed class DailyReportJob(ILogger<DailyReportJob> logger) : IBackgroundJob
{
public Task ExecuteAsync(CancellationToken ct = default)
{
logger.LogInformation("Daily report");
return Task.CompletedTask;
}
}
// Schedule it — 5-field crontab (converted for Quartz) or a Quartz expression (seconds first, "0 0 8 * * ?")
public sealed class ReportSetup(IJobScheduler scheduler)
{
public Task StartAsync(CancellationToken ct) =>
scheduler.AddOrUpdateRecurringAsync<DailyReportJob>("daily-report", "0 8 * * *", ct); // every day at 08:00
}
IJobScheduler also offers EnqueueAsync<TJob>() (run now), ScheduleAsync<TJob>(delay) and
RemoveRecurringAsync(jobId).
Configuration
Pass a Quartz.NET 4 builder callback for anything beyond the defaults (persistent store, thread pool, misfire handling):
builder.Services.AddKckBackgroundJobsQuartz(q =>
{
q.UseDefaultThreadPool(tp => tp.MaxConcurrency = 10);
});
See the Quartz.NET 4 documentation for the builder API.
Quartz 4 changed some defaults (for example cron triggers without a time zone use DefaultTimeZone); check the
Quartz migration guide when upgrading from Kck 3.x.
Resources
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Kck.BackgroundJobs.Abstractions (>= 4.8.0)
- Quartz (>= 4.6.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Kck.BackgroundJobs.Quartz:
| Package | Downloads |
|---|---|
|
Kck.Bundle.WorkerService
Opinionated .NET Worker Service starter pack. Registers Serilog, health checks, InMemory event bus, and the Quartz background job scheduler in a single call. |
GitHub repositories
This package is not used by any popular GitHub repositories.