SimplyWorks.Scheduler.Sdk 8.1.0

dotnet add package SimplyWorks.Scheduler.Sdk --version 8.1.0
                    
NuGet\Install-Package SimplyWorks.Scheduler.Sdk -Version 8.1.0
                    
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="SimplyWorks.Scheduler.Sdk" Version="8.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimplyWorks.Scheduler.Sdk" Version="8.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SimplyWorks.Scheduler.Sdk" />
                    
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 SimplyWorks.Scheduler.Sdk --version 8.1.0
                    
#r "nuget: SimplyWorks.Scheduler.Sdk, 8.1.0"
                    
#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 SimplyWorks.Scheduler.Sdk@8.1.0
                    
#: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=SimplyWorks.Scheduler.Sdk&version=8.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SimplyWorks.Scheduler.Sdk&version=8.1.0
                    
Install as a Cake Tool

SW.Scheduler.Sdk

Lightweight SDK package for SW.Scheduler — contains all public interfaces and contracts. Reference this package in projects that define scheduled jobs, without pulling in any Quartz or infrastructure dependencies.

📦 What's in this package

  • IScheduledJob — simple scheduled job interface
  • IScheduledJob<TParam> — parameterized scheduled job interface
  • IScheduleRepository — runtime scheduling and management
  • IScheduleReader — read-only execution history queries
  • ISchedulerViewerQuery — query interface used by the admin UI
  • ISchedulerViewerCommand — command interface used by the admin UI
  • ScheduleAttribute — declarative startup scheduling
  • ScheduleConfigAttribute — concurrency and misfire configuration
  • RetryConfigAttribute — self-rescheduling retry strategy
  • ScheduleConfig — runtime override of scheduling options
  • SchedulerOptions — global scheduler configuration
  • MisfireInstructions — misfire behaviour enum
  • JobExecution — execution history record
  • JobSummary — job state snapshot for the admin UI

🎯 When to use this package

Project type Package
Projects that define jobs (IScheduledJob) SimplyWorks.Scheduler.Sdk
Projects that inject IScheduleRepository SimplyWorks.Scheduler.Sdk
Host / startup project that runs the scheduler SimplyWorks.Scheduler
Host with PostgreSQL persistent store SimplyWorks.Scheduler.PgSql
Host with SQL Server persistent store SimplyWorks.Scheduler.SqlServer
Host with MySQL persistent store SimplyWorks.Scheduler.MySql
Admin UI dashboard SimplyWorks.Scheduler.Viewer

📥 Installation

# In your API / job-definition project
dotnet add package SimplyWorks.Scheduler.Sdk

# In your host / startup project
dotnet add package SimplyWorks.Scheduler          # in-memory (dev/test)
dotnet add package SimplyWorks.Scheduler.PgSql    # PostgreSQL
dotnet add package SimplyWorks.Scheduler.SqlServer # SQL Server
dotnet add package SimplyWorks.Scheduler.MySql    # MySQL / MariaDB

🏗️ Architecture

┌──────────────────────────────────────────────────┐
│  Your API / Job-definition Project               │
│  └─ SimplyWorks.Scheduler.Sdk  (lightweight)     │
│                                                  │
│  using SW.Scheduler;                             │
│                                                  │
│  [Schedule("0 0 8 * * ?")]                       │
│  public class MyJob : IScheduledJob { ... }      │
└──────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────┐
│  Host / Startup Project                          │
│  └─ SimplyWorks.Scheduler.PgSql  (full library)  │
│                                                  │
│  builder.Services.AddPgSqlScheduler(...);        │
│  modelBuilder.UseSchedulerPostgreSql("quartz");  │
└──────────────────────────────────────────────────┘

🚀 Example usage

Simple job (declarative scheduling via attribute)

using SW.Scheduler;

[Schedule("0 0 2 * * ?", Description = "Nightly backup at 2 AM")]
[RetryConfig(MaxRetries = 3, RetryAfterMinutes = 5)]
[ScheduleConfig(AllowConcurrentExecution = false, MisfireInstructions = MisfireInstructions.FireOnce)]
public class BackupJob : IScheduledJob
{
    private readonly ILogger<BackupJob> _logger;

    public BackupJob(ILogger<BackupJob> logger) => _logger = logger;

    public async Task Execute()
    {
        _logger.LogInformation("Running backup...");
        await Task.CompletedTask;
    }
}

Parameterized job (runtime scheduling only)

using SW.Scheduler;

public record ReportParams(string Format, string Recipient);

[ScheduleConfig(AllowConcurrentExecution = true)]
[RetryConfig(MaxRetries = 5, RetryAfterMinutes = 10)]
public class GenerateReportJob : IScheduledJob<ReportParams>
{
    public async Task Execute(ReportParams p)
    {
        Console.WriteLine($"Generating {p.Format} report for {p.Recipient}");
        await Task.CompletedTask;
    }
}

Runtime scheduling via IScheduleRepository

using SW.Scheduler;

public class MyService(IScheduleRepository scheduler)
{
    // Simple job — override the attribute cron at runtime
    public Task OverrideBackupSchedule(string newCron)
        => scheduler.Schedule<BackupJob>(newCron);

    // Parameterized job — create a named recurring schedule
    public Task CreateReportSchedule(string scheduleKey, string cron)
        => scheduler.Schedule<GenerateReportJob, ReportParams>(
               new ReportParams("PDF", "admin@example.com"),
               cronExpression: cron,
               scheduleKey: scheduleKey);

    // One-off execution
    public Task<string> RunReportNow()
        => scheduler.ScheduleOnce<GenerateReportJob, ReportParams>(
               new ReportParams("CSV", "ops@example.com"));

    // Pause / Resume / Unschedule
    public Task Pause()  => scheduler.PauseJob<BackupJob>();
    public Task Resume() => scheduler.ResumeJob<BackupJob>();
    public Task Remove() => scheduler.UnscheduleJob<BackupJob>();
}

📋 API reference

IScheduledJob

public interface IScheduledJob : IScheduledJobBase
{
    Task Execute();
}

IScheduledJob<TParam>

public interface IScheduledJob<TParam> : IScheduledJobWithParams
{
    Task Execute(TParam jobParams);
}

IScheduleRepository (key methods)

public interface IScheduleRepository
{
    // Simple jobs
    Task Schedule<TJob>(string cronExpression, ScheduleConfig? config = null)
        where TJob : IScheduledJob;
    Task ScheduleOnce<TJob>(DateTime? runAt = null)
        where TJob : IScheduledJob;
    Task RescheduleJob<TJob>(string newCronExpression)
        where TJob : IScheduledJob;
    Task PauseJob<TJob>()   where TJob : IScheduledJob;
    Task ResumeJob<TJob>()  where TJob : IScheduledJob;
    Task UnscheduleJob<TJob>() where TJob : IScheduledJob;

    // Parameterized jobs
    Task Schedule<TJob, TParam>(TParam param, string cronExpression, string scheduleKey, ScheduleConfig? config = null)
        where TJob : IScheduledJob<TParam>;
    Task<string> ScheduleOnce<TJob, TParam>(TParam param, DateTime? runAt = null)
        where TJob : IScheduledJob<TParam>;
    Task RescheduleJob<TJob, TParam>(string scheduleKey, string newCronExpression)
        where TJob : IScheduledJob<TParam>;
    Task PauseJob<TJob, TParam>(string scheduleKey)   where TJob : IScheduledJob<TParam>;
    Task ResumeJob<TJob, TParam>(string scheduleKey)  where TJob : IScheduledJob<TParam>;
    Task UnscheduleJob<TJob, TParam>(string scheduleKey) where TJob : IScheduledJob<TParam>;

    IEnumerable<IScheduledJobDefinition> GetJobDefinitions();
}

Attributes

// Declarative startup schedule — IScheduledJob only
[Schedule("0 0 8 * * ?", Description = "Daily at 8 AM")]

// Concurrency and misfire behaviour — both job types
[ScheduleConfig(AllowConcurrentExecution = false, MisfireInstructions = MisfireInstructions.FireOnce)]

// Self-rescheduling retry — both job types
[RetryConfig(MaxRetries = 3, RetryAfterMinutes = 5)]

MisfireInstructions

public enum MisfireInstructions
{
    FireOnce, // fire once immediately on misfire (default)
    Skip,     // skip missed executions
    Ignore,   // catch up all missed executions
}

🔗 Dependencies

None. This is a pure interface/contract package with no external dependencies.

📚 Documentation

📄 License

MIT

Product Compatible and additional computed target framework versions.
.NET 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.  net9.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on SimplyWorks.Scheduler.Sdk:

Package Downloads
SimplyWorks.Scheduler

Host/startup package for SW.Scheduler — a type-safe Quartz.NET wrapper for .NET 8+. Provides in-memory scheduling, job discovery, retry strategies, and job execution monitoring. Use alongside a provider package (SimplyWorks.Scheduler.PgSql, SqlServer, or MySql) for persistent storage.

SimplyWorks.Scheduler.EfCore

EF Core integration for SW.Scheduler. Provides job execution monitoring, execution history storage, and the ISchedulerViewerQuery implementation. Call AddSchedulerMonitoring<TDbContext>() and add ApplyScheduling() in your DbContext to enable.

SimplyWorks.Scheduler.Viewer

Built-in HTMX admin UI for SW.Scheduler. Mounts a server-rendered dashboard (Pico.css + HTMX) at a configurable route. Displays running jobs, execution history, and provides Pause / Resume / Reschedule / Unschedule controls. Authentication is delegated to the host application via a configurable delegate.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.1.0 194 3/10/2026