OxCore.QuantumQueue.Core
9.0.8
dotnet add package OxCore.QuantumQueue.Core --version 9.0.8
NuGet\Install-Package OxCore.QuantumQueue.Core -Version 9.0.8
<PackageReference Include="OxCore.QuantumQueue.Core" Version="9.0.8" />
<PackageVersion Include="OxCore.QuantumQueue.Core" Version="9.0.8" />
<PackageReference Include="OxCore.QuantumQueue.Core" />
paket add OxCore.QuantumQueue.Core --version 9.0.8
#r "nuget: OxCore.QuantumQueue.Core, 9.0.8"
#:package OxCore.QuantumQueue.Core@9.0.8
#addin nuget:?package=OxCore.QuantumQueue.Core&version=9.0.8
#tool nuget:?package=OxCore.QuantumQueue.Core&version=9.0.8
π OxCore.QuantumQueue
OxCore.QuantumQueue is a lightweight, CRON-based job scheduler for .NET applications. Designed to be modular and developer-friendly, it lets you easily run background tasks with precise control over execution timing.
π¦ Installation
Install the NuGet package:
.NET CLI
dotnet add package OxCore.QuantumQueue.Core --version 9.0.8
Package Manager
Install-Package OxCore.QuantumQueue.Core --version 9.0.8
βοΈ Getting Started
To start using OxCore.QuantumQueue, follow these steps in your .NET Core app.
1β£ Register Services
Add the following in your Program.cs:
builder.Services.OxCoreService(builder.Configuration);
This registers all required services and job dependencies into the DI container.
2β£ Configure Jobs in appsettings.json
Use a simplified format to declare CRON intervals:
"SchedulerSettings": {
"Enabled": true,
"Jobs": {
"SampleJob": {
"Enabled": true,
"Expression": "*/1 * * * *"
},
"DataSyncJob": {
"Enabled": true,
"Expression": "*/2 * * * *"
}
}
}
3β£ Create a Job
Implement the ConfigurableJobBase<T> and IJob interface to define a recurring background task:
using OxCore.QuantumQueue;
public class SampleJob : ConfigurableJobBase<SampleJob>, IJob
{
public SampleJob(Func<string, ILogger> getLogger, IOptionsMonitor<SchedulerSettings> jobOptions)
: base(getLogger, jobOptions) { }
public async Task ExecuteAsync(CancellationToken cancellationToken)
{
Logger.LogInformation($"[SampleJob] Executed at: {DateTime.Now} with interval: {Interval}");
await Task.Delay(30000, cancellationToken);
}
}
π§ͺ Example: Data Sync Job
public class DataSyncJob : ConfigurableJobBase<DataSyncJob>, IJob
{
public DataSyncJob(Func<string, ILogger> getLogger, IOptionsMonitor<SchedulerSettings> jobOptions)
: base(getLogger, jobOptions) { }
public async Task ExecuteAsync(CancellationToken cancellationToken)
{
Logger.LogInformation($"[DataSyncJob] Executed at: {DateTime.Now} with interval: {Interval}");
await MySyncService.SynchronizeAsync();
}
}
4β£ Register the Job
You do not need to manually register your job; it is automatically discovered and registered by the application.
β° CRON Expression Guide
| Field | Allowed Values | Description |
|---|---|---|
| Minute | 0β59 | Minute of the hour |
| Hour | 0β23 | Hour of the day |
| Day of month | 1β31 | Day of the month |
| Month | 1β12 or JANβDEC | Month |
| Day of week | 0β6 or SUNβSAT | Day of the week (0 = Sun) |
Examples:
*/5 * * * *β every 5 minutes0 0 * * *β every day at midnight0 12 * * 1β every Monday at 12:00 PM
Use crontab.guru to generate or validate CRON expressions.
π Scoped Job Dependency Support
You can inject services inside your jobs using constructor injection:
public class EmailJob : ConfigurableJobBase<EmailJob>, IJob
{
private readonly IEmailService _emailService;
public EmailJob(Func<string, ILogger> getLogger, IOptions<JobSettings> jobOptions, IEmailService emailService)
: base(getLogger, jobOptions)
{
_emailService = emailService;
}
public async Task ExecuteAsync(CancellationToken cancellationToken)
{
await _emailService.SendScheduledEmailsAsync();
}
}
Make sure to register the dependency in Program.cs:
builder.Services.AddScoped<IEmailService, EmailService>();
π§Ή Features
- β Simple setup and lightweight design
- β±οΈ Flexible CRON-based scheduling
- β»οΈ Supports scoped DI with
ConfigurableJobBase<FirstJob>andIJob - π₯΅ Thread-safe and cancellation-aware
- π Automatically discovers and runs all registered jobs
- π§ͺ Testable architecture with modular components
π οΈ Advanced Configuration (coming soon)
Custom options for:
- Retry policies
- Error handling strategies
- Dynamic job enable/disable
- Job health monitoring
Stay tuned for future releases!
π§Ό Best Practices
- Avoid blocking threads (use
async/await) - Use logging to trace job runs
- Wrap your job logic in try-catch blocks to prevent silent failures
π License
This project is licensed under the MIT License.
π€ Contributing
We welcome community contributions! GitHub.
To contribute:
- Fork the repo
- Create a new feature branch
- Submit a pull request
Created with β€οΈ by OxCore Team (Prabuddha Jayawardhana)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.4)
- OxCore.QuantumQueue.SharedKernel (>= 9.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 9.0.8 | 507 | 6/12/2025 | |
| 9.0.6 | 276 | 6/8/2025 | |
| 9.0.5 | 166 | 6/7/2025 | |
| 9.0.4 | 173 | 6/7/2025 | |
| 9.0.3 | 143 | 6/6/2025 | |
| 9.0.2 | 185 | 6/6/2025 | |
| 9.0.1 | 170 | 6/6/2025 | |
| 9.0.0 | 205 | 5/18/2025 | |
| 8.0.11 | 198 | 5/18/2025 | |
| 8.0.10 | 438 | 5/18/2025 | |
| 8.0.9 | 440 | 5/18/2025 | |
| 8.0.8 | 437 | 5/18/2025 | |
| 8.0.7 | 441 | 5/18/2025 | |
| 8.0.6 | 437 | 5/18/2025 | |
| 8.0.5 | 195 | 5/18/2025 | |
| 8.0.4 | 197 | 5/18/2025 | |
| 8.0.3 | 208 | 5/18/2025 | |
| 8.0.2 | 198 | 5/18/2025 | |
| 8.0.1 | 199 | 5/18/2025 | |
| 8.0.0 | 295 | 5/18/2025 |