OxCore.QuantumQueue.Core
8.0.6
See the version list below for details.
dotnet add package OxCore.QuantumQueue.Core --version 8.0.6
NuGet\Install-Package OxCore.QuantumQueue.Core -Version 8.0.6
<PackageReference Include="OxCore.QuantumQueue.Core" Version="8.0.6" />
<PackageVersion Include="OxCore.QuantumQueue.Core" Version="8.0.6" />
<PackageReference Include="OxCore.QuantumQueue.Core" />
paket add OxCore.QuantumQueue.Core --version 8.0.6
#r "nuget: OxCore.QuantumQueue.Core, 8.0.6"
#:package OxCore.QuantumQueue.Core@8.0.6
#addin nuget:?package=OxCore.QuantumQueue.Core&version=8.0.6
#tool nuget:?package=OxCore.QuantumQueue.Core&version=8.0.6
π 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 8.0.6
Package Manager
Install-Package OxCore.QuantumQueue.Core --version 8.0.6
βοΈ 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();
This registers all required services and job dependencies into the DI container.
2β£ Enable Job Scheduler Middleware
After configuring your app and building it, add this line:
app.UseJobScheduler();
This activates the job scheduler and runs all registered jobs based on their defined schedules.
3β£ Create a Job
Implement the IJob
interface to define a recurring background task:
using OxCore.QuantumQueue;
public class SampleJob : IJob
{
public string CronExpression => "*/5 * * * *"; // every 5 minutes
public async Task ExecuteAsync(CancellationToken cancellationToken)
{
Console.WriteLine($"[SampleJob] Executed at: {DateTime.Now}");
await Task.CompletedTask;
}
}
4β£ Register the Job
You do not need to manually register your job; it is automatically discovered and registered by the application.
π§ͺ Example: Data Sync Job
public class DataSyncJob : IJob
{
public string CronExpression => "0 */6 * * *"; // Every 6 hours
public async Task ExecuteAsync(CancellationToken cancellationToken)
{
Console.WriteLine("[DataSyncJob] Syncing data...");
await MySyncService.SynchronizeAsync();
}
}
β° 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 : IJob
{
private readonly IEmailService _emailService;
public EmailJob(IEmailService emailService)
{
_emailService = emailService;
}
public string CronExpression => "0 8 * * *"; // Every day at 8 AM
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
IJob
- π₯΅ 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!
To contribute:
- Fork the repo
- Create a new feature branch
- Submit a pull request
Created with β€οΈ by OxCore Team (Prabuddha Jayawardhana)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- OxCore.QuantumQueue.SharedKernel (>= 8.0.0)
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 | 370 | 6/12/2025 | |
9.0.6 | 207 | 6/8/2025 | |
9.0.5 | 107 | 6/7/2025 | |
9.0.4 | 113 | 6/7/2025 | |
9.0.3 | 83 | 6/6/2025 | |
9.0.2 | 114 | 6/6/2025 | |
9.0.1 | 114 | 6/6/2025 | |
9.0.0 | 149 | 5/18/2025 | |
8.0.11 | 141 | 5/18/2025 | |
8.0.10 | 143 | 5/18/2025 | |
8.0.9 | 142 | 5/18/2025 | |
8.0.8 | 137 | 5/18/2025 | |
8.0.7 | 141 | 5/18/2025 | |
8.0.6 | 140 | 5/18/2025 | |
8.0.5 | 140 | 5/18/2025 | |
8.0.4 | 139 | 5/18/2025 | |
8.0.3 | 143 | 5/18/2025 | |
8.0.2 | 143 | 5/18/2025 | |
8.0.1 | 143 | 5/18/2025 | |
8.0.0 | 232 | 5/18/2025 | |
1.0.4 | 190 | 5/18/2025 | |
1.0.3 | 97 | 5/17/2025 | |
1.0.2 | 101 | 5/17/2025 | |
1.0.1 | 97 | 5/17/2025 | |
1.0.0 | 272 | 5/17/2025 |