OxCore.QuantumQueue.Core 8.0.6

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OxCore.QuantumQueue.Core" Version="8.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OxCore.QuantumQueue.Core" Version="8.0.6" />
                    
Directory.Packages.props
<PackageReference Include="OxCore.QuantumQueue.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OxCore.QuantumQueue.Core --version 8.0.6
                    
#r "nuget: OxCore.QuantumQueue.Core, 8.0.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OxCore.QuantumQueue.Core@8.0.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OxCore.QuantumQueue.Core&version=8.0.6
                    
Install as a Cake Addin
#tool nuget:?package=OxCore.QuantumQueue.Core&version=8.0.6
                    
Install as a Cake Tool

πŸŒ€ 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 minutes
  • 0 0 * * * – every day at midnight
  • 0 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:

  1. Fork the repo
  2. Create a new feature branch
  3. Submit a pull request

Created with ❀️ by OxCore Team (Prabuddha Jayawardhana)

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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 8.0.0 is deprecated because it is no longer maintained.
1.0.4 190 5/18/2025 1.0.4 is deprecated because it is no longer maintained.
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