ZeroAlloc.Scheduling 2.2.11

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

ZeroAlloc.Scheduling

NuGet Build License: MIT AOT GitHub Sponsors

Source-generated background jobs for .NET: mark a class with [Job] and get one-off, delayed and cron jobs with retries, durable stores and a dashboard, with no runtime registration cost and NativeAOT support.

Why ZeroAlloc.Scheduling

  • No runtime registration cost. [Job] registration is generated at compile time. Coravel's Schedule() allocates 696 B per call, measured in the same run.
  • Dispatch costs what a hand-written timer costs. BenchmarkDotNet cannot tell a ZA.Scheduling dispatch from an empty method, just as it can't for a direct call. A test asserts the worker allocates nothing per job beyond the JobContext it hands to the job.
  • Works under NativeAOT and trimming. Executors and DI registration are generated, with no reflection or assembly scanning. CI publishes and runs an AOT app over the in-memory, ORM and Redis stores and the Mediator, Resilience and Telemetry bridges.
  • Compile-time diagnostics. The generator flags jobs it cannot register, such as nested or generic job types or two jobs that would get the same registration method.

Install

dotnet add package ZeroAlloc.Scheduling
dotnet add package ZeroAlloc.Scheduling.InMemory

The source generator ships inside ZeroAlloc.Scheduling. Swap the in-memory store for EF Core, ZeroAlloc.ORM or Redis in production.

Quick start

using System.Text.Json.Serialization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using ZeroAlloc.Scheduling;
using ZeroAlloc.Scheduling.InMemory;
using ZeroAlloc.Serialisation;

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddSerializerDispatcher(); // generated, AOT-safe job serializer
builder.Services.AddScheduling(o => o.PollingInterval = TimeSpan.FromMilliseconds(100))
    .WithInMemoryStore()          // or EfCore, Orm or Redis in production
    .AddSendWelcomeEmailJob();    // generated for the [Job] class
using var host = builder.Build();
await host.StartAsync();

var scheduler = host.Services.GetRequiredService<IScheduler>();
await scheduler.EnqueueAsync(new SendWelcomeEmailJob { To = "alice@example.com" });
await Task.Delay(500); // the worker picks it up, with retries if it throws
await host.StopAsync();

[Job(MaxAttempts = 5)]
[ZeroAllocSerializable(SerializationFormat.SystemTextJson)]
public sealed class SendWelcomeEmailJob : IJob
{
    public required string To { get; init; }

    public ValueTask ExecuteAsync(JobContext ctx, CancellationToken ct)
    {
        Console.WriteLine($"Welcome mail to {To}, attempt {ctx.Attempt}");
        return ValueTask.CompletedTask;
    }
}

[JsonSerializable(typeof(SendWelcomeEmailJob))]
internal sealed partial class AppJson : JsonSerializerContext;

For a recurring job, use [Job(Cron = "0 * * * *")] or [Job(Every = Every.Hour)]: the generator also emits a hosted service that schedules it at startup. The getting started guide covers delays, retries and stores.

What you get

  • One-off jobs, delayed jobs and recurring jobs from cron expressions or fixed intervals.
  • Exponential-backoff retry per job or globally, then dead-lettering.
  • A background worker that polls the store in batches and runs each job through its generated executor.
  • Targets .NET 8, 9 and 10.

Stores and integrations:

Scheduler dashboard

Performance

Against Coravel 6.0.2 and a hand-rolled BackgroundService + Timer. BenchmarkDotNet 0.15.8, .NET 10.0.13, measured 2026-10-15. Allocations are exact; speed is a same-run ratio, because the benchmark host is a shared VM.

Operation Coravel Hand-rolled Timer ZA.Scheduling
Register one job 696 B per Schedule() call — none at runtime, generated at compile time
Register 100 jobs 76,320 B, 15.36× the time of one call — none at runtime
Single dispatch — indistinguishable from an empty method indistinguishable from an empty method

What you pay for is [Job] itself: declarative retries, cron and store-backed persistence, not dispatch speed. Full methodology: docs/performance.md.

Learn more

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 is compatible.  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 is compatible.  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.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on ZeroAlloc.Scheduling:

Package Downloads
ZeroAlloc.Scheduling.EfCore

EF Core job store adapter for ZeroAlloc.Scheduling.

ZeroAlloc.Scheduling.Redis

Redis job store adapter for ZeroAlloc.Scheduling.

ZeroAlloc.Scheduling.InMemory

In-memory job store for ZeroAlloc.Scheduling — use in tests.

ZeroAlloc.Scheduling.Dashboard

Minimal API dashboard for ZeroAlloc.Scheduling — JSON endpoints + embedded HTML/JS UI.

ZeroAlloc.Scheduling.Mediator

ZeroAlloc.Mediator bridge for ZeroAlloc.Scheduling — dispatches jobs via IMediator.Send.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.11 0 10/16/2026
2.2.10 29 10/15/2026
2.2.9 254 10/12/2026
2.2.8 217 10/12/2026
2.2.7 238 10/11/2026
2.2.6 287 10/11/2026
2.2.5 241 10/11/2026
2.2.4 228 10/11/2026
2.2.3 218 10/11/2026
2.2.2 219 10/10/2026
2.2.1 230 10/10/2026
2.2.0 232 10/10/2026
2.1.0 243 10/10/2026
2.0.17 221 10/10/2026
2.0.15 225 10/9/2026
2.0.14 216 10/7/2026
2.0.13 227 10/7/2026
2.0.12 221 10/6/2026
2.0.11 223 10/4/2026
2.0.10 224 10/3/2026
Loading failed