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
<PackageReference Include="SimplyWorks.Scheduler.Sdk" Version="8.1.0" />
<PackageVersion Include="SimplyWorks.Scheduler.Sdk" Version="8.1.0" />
<PackageReference Include="SimplyWorks.Scheduler.Sdk" />
paket add SimplyWorks.Scheduler.Sdk --version 8.1.0
#r "nuget: SimplyWorks.Scheduler.Sdk, 8.1.0"
#:package SimplyWorks.Scheduler.Sdk@8.1.0
#addin nuget:?package=SimplyWorks.Scheduler.Sdk&version=8.1.0
#tool nuget:?package=SimplyWorks.Scheduler.Sdk&version=8.1.0
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 interfaceIScheduledJob<TParam>— parameterized scheduled job interfaceIScheduleRepository— runtime scheduling and managementIScheduleReader— read-only execution history queriesISchedulerViewerQuery— query interface used by the admin UIISchedulerViewerCommand— command interface used by the admin UIScheduleAttribute— declarative startup schedulingScheduleConfigAttribute— concurrency and misfire configurationRetryConfigAttribute— self-rescheduling retry strategyScheduleConfig— runtime override of scheduling optionsSchedulerOptions— global scheduler configurationMisfireInstructions— misfire behaviour enumJobExecution— execution history recordJobSummary— 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
- Main README — full setup guide
- SampleApplication — runnable reference app
📄 License
MIT
| Product | Versions 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. |
-
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 |
See https://github.com/simplify9/SW-SimplyScheduler/releases for release notes.