ZeroAlloc.Scheduling Documentation
Source-generated background job scheduler for .NET 8 and .NET 10.
Reference
| # | Guide | Description |
|---|---|---|
| 1 | Getting Started | Install and schedule your first job in five minutes |
| 2 | Source Generator | [Job], Every, Cron, generated extension methods |
| 3 | Backends | InMemory, EF Core, and Redis store configuration |
| 4 | Dashboard | Embedded HTML dashboard and Blazor component |
| 5 | Mediator Bridge | Route job execution through ZeroAlloc.Mediator |
| 6 | Diagnostics | ZASCH001 compiler warning reference |
| 7 | Performance | Throughput, allocation profile, and tuning guide |
Quick Reference
// Fire-and-forget job
[Job]
public sealed class SendWelcomeEmailJob : IJob
{
public async ValueTask ExecuteAsync(JobContext ctx, CancellationToken ct) { ... }
}
services.AddScheduling().AddSchedulingInMemory().AddSendWelcomeEmailJob();
// Recurring job (every hour)
[Job(Every = Every.Hour)]
public sealed class PurgeExpiredTokensJob : IJob
{
public async ValueTask ExecuteAsync(JobContext ctx, CancellationToken ct) { ... }
}
// AddPurgeExpiredTokensJob() also registers an IHostedService that seeds the schedule on startup
// Recurring job (custom cron)
[Job(Cron = "0 9 * * 1-5")] // weekdays at 09:00
public sealed class DailyReportJob : IJob { ... }
// Dashboard
app.MapJobsDashboard("/jobs");